Leafpub/leafpub

Frontend menu items point to a deleted post/page

karsasmus opened this issue ยท 2 comments

Thanks for using Postleaf! ๐Ÿ’™๐Ÿ’š

This issue tracker is ONLY for bug reports. If you need help with something or would like to request a feature, please ask on https://community.postleaf.org/ instead.


Issue Summary

After deleting a post, which was linked in the frontend menu, the menu item will not be deleted. If you click on that menu item, postleaf generates a 404.

We should check the menu items if they exist or not.

Steps to Reproduce

Tell us how to replicate the problem.

  1. Link a post/page in the menu
  2. Delete the post/page
  3. Click the menu link in frontend

Additional info

  • Postleaf version: master branch
  • PHP version: 5.5.9
  • Affected browsers: Chrome 52
  • Operating system: Ubuntu/ChromeOS

Navigation is decoupled from posts. I don't think we should bother checking for this, as users might not expect that to happen. For example, what if you delete a page and then recreate it? (Granted, it's a terrible practice on a production site, but still.)

Plus, if we do this with posts, we'll have to extend the same behavior to tags and users too.

At the moment, navigation is "dumb." You can put whatever you want in the text box and it will be accepted. If, in the future, navigation becomes smarter (e.g. nav links point to actual resources) then this would definitely make sense.

Ok, I'll put this on my to-do list for V2.0 ๐Ÿ˜„