Hi,

I'm new to midgard / aegir development, and I'm stuck on a problem regarding the deletion of attachments. I have a topic/article database in my system. Some topics have attachments (e.g. pictures, binaries, etc.).

the code looks like this:

$topic = mgd_get_topic_by_name( 0, "topic name");
if ($topic)
{
$att = $topic->listattachments();
while ($att->fetch())
{
if ( $att->id == $object_delete_id )
{
$datt = mgd_get_attachment( $object_delete_id);
if ($datt->delete())
echo "success";
else
echo mgd_errstr();
}
}
}

As you can see, when the blob's ID is equal to $object_delete_id, I want it to go away. However, I get the error "Resource has dependants", and the delete fails.

How can an attachment have further dependants? What am I doing wrong?

Thanks,
/Jim



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

Reply via email to