Thanks for the reply Armand.

I have comments below.





Regards,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
William Shine   
Systems Analyst                
QNX Software Systems Ltd.         Email: [EMAIL PROTECTED] 
Kanata, Ontario  K2M 1W8         (613) 591-0931 ext.9143
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On 25 Nov 2002, Armand A. Verstappen wrote:

> On Mon, 2002-11-25 at 18:06, Will Shine wrote:
> > I am having troubles getting mgd_create_article to work.
> >=20
> > I was getting an access denied error from the sample code supplied on the=
> =20
> > web site until i adjusted permissions.
> >=20
> > Now I fixed the permissions so that I no longer get an access denied=20
> > error but now I get an object does not exist error.
> >=20
> > Is there something that I am missing here?
> 
> Maybe. An article needs to be in a topic, so you'd call:
> 
> $topic =3D mgd_get_topic($id_of_topic_you_want_to_create_article_in);

Taking your advice Armand I did just that. Indeed I was able to display 

a $topic->name and $topic->id which correspond to my topic name and number.


I also used $topic->id as the topic parameter in mgd_create_article call.



> 
> if (!$topic)
> {
>  echo "could not get topic, bailing out<br>\n";
>  exit;
> }
> 
> mgd_create_article($up, $topic->id, ...);
> 
> You could also use the oop approach as suggested on:
> 
> http://www.midgard-project.org/manual/en/method.object-create.php
> 

I switched to the oop way of doing this.

When I do a $article=mgd_get_article()

I see no problems at the start.

I go through the same stuff as in the example

$article->name=$name;
$article->title=$title;

etc.

When I call the create method, nothing seems to happen.

Afterwards,

$article->id becomes Object

and when I display mgd_errno() on the page, I see 

Object does not exist.

I also checked the articles table, and saw nothing there, and I could see 
no new articles in the admin web page



> but at any rate be sure that the topic you want to create the article in
> exists, and that the up field is either zero or points to an existing
> article.

I have verified this, by putting in bogus values for topic and I do get 
an error stating a failure on the create method.

> 
> wkr,
> =20
> --=20
> Envida                     http://www.envida.net/
> Armand A. Verstappen       Graadt van Roggenweg 328
> [EMAIL PROTECTED]       3531 AH Utrecht
> tel: +31 (0)30 298 2255    Postbus 19127
> fax: +31 (0)30 298 2111    3501 DC Utrecht
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to