Moc / cookbook

Important: NOT READY FOR RELEASE YET!! A fully featured Cookbook plugin for e107, for all your recipes. Includes functionalities such as categorization, sharing, and bookmarking.
Apache License 2.0
2 stars 3 forks source link

Duplicated use of category menu causes fatal erroru #19

Closed Jimmi08 closed 2 years ago

Jimmi08 commented 2 years ago

Bug Description

Fatal error: Cannot declare class cookbook_categoriesmenu, because the name is already in use in ***\cookbook\cookbook_categories_menu.php on line 21

How to Reproduce

Steps to reproduce the behavior:

  1. Add the category menu 2x on the same layout

Could you add a check if class already exists?

Thanks

Moc commented 2 years ago

I'll add it.

Not sure why you would want two of the same menus on the same page though...

Jimmi08 commented 2 years ago

You never know - in my case I just tested sidebar with 3 different menu areas (see core bootstrap5 theme, it uses 2) and ended with this error. In real life it should be never used, but if anybody do similar mistake (and it is very easy to do with the way how you are adding menus in menu manager), there will be no error. Just detail to avoid future complications.