Ticket #267 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

Deleting post from admin/publish results in fatal error

Reported by: itrebal Owned by:
Priority: major Milestone: Undetermined
Component: Habari Core Software Version: SVN
Keywords: has_patch Cc:

Description

On the page http://iamgraham.net/admin/publish?slug=foobar, clicking on the Delete button taking me to http://iamgraham.net/admin/delete_post?slug=foobar results in a fatal error:

Fatal error: Call to a member function delete() on a non-object in /home/itrebal/iamgraham.net/blog/public_html/system/classes/adminhandler.php on line 301

Attachments

adminhandler_publish_delete.php (43.9 kB) - added by rickc 7 months ago.
adminhandler_publish_delete.diff (0.6 kB) - added by rickc 7 months ago.

Change History

Changed 7 months ago by skippy

I believe this is related to your #268. Do you have a "scheduled" post status defined in the DB? If not, add one. Then try deleting again. I experienced this same problem when testing the scheduled post patch.

Changed 7 months ago by rickc

  • keywords has_patch added
  • component changed from -none- to Habari Core Software

This only happens with posts with a status of 'scheduled'. The post delete function only uses the post slug to retrieve the post so it can be deleted. Other post-related functions in the admin handler use the post slug and a status of 'any'. The attached patch fixes the bug by passing a status of 'any' along with the slug to retrieve the post for deletion.

Changed 7 months ago by rickc

Changed 7 months ago by rickc

Changed 7 months ago by rickc

Ignore the file adminhandler_publish_delete.php . I uploaded it by accident.

Changed 7 months ago by freakerz

  • status changed from new to closed
  • resolution set to fixed

Committed patch in r1598.

Thanks rickc!

Note: See TracTickets for help on using tickets.