Hi,
I am playing around with the $article->create() method, but I run into
trouble. I have created the following script:
<?php
$article = mgd_get_article();
$article->title = "\$article->create(); example";
$article->abstract = "Creating articles is easy ...";
$article->content = "Creating articles is easy, and the
\$article->create() ";
$article->content .= "function makes it easier. Also your code will be
more ";
$article->content .= "readable, which is A Good Thing (tm).";
$article->author = $midgard->user;
mgd_errno();
$id = $article->create();
if(!$id) {
echo "Failed to create article<br>\n";
echo "Reason: " . mgd_errstr(mgd_errno()) . "\n";
} else {
echo "Article created. ID of article is $id.<br>\n";
$attachment = $article->createattachment("name","title","text/html");
if(!$attachment) {
echo "Failed to create attachment.<br>\n";
echo "Reason: " . mgd_errstr(mgd_errno()) . "\n";
} else {
echo "Created attachment. ID of attachment is $attachment.<br>\n";
}
}
?>
Which results in the following output:
Article created. ID of article is 17.
Failed to create attachment.
Reason: Object does not exist
So I do succeed in creating an article, and I would assume that that would
only be possible if the $article object would exist.
LogLevel is set to debug, no relevant messages though.
What's wrong in this picture?
--
Armand A. Verstappen * <[EMAIL PROTECTED]> *
--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org
To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]