Need help finding a bug in menu system
Added by Jeff Flesher about 10 years ago
I have a Menu system in my CMS, it has a define for MENU to debug this problem, what I have is a bug that is crashing the session.
The Menu system is database driven, it creates a structure that is used to create the Menu System,
on the Right is an Options Dropdown, it has Theme, and many themes to pick from,
but with MENU Defined, when you click on the Theme, it changes, but if you hit refresh, it reverts back,
this is because the Cookie reverts back, I can use a debugger to see the cookie value changes, but not sure why it changes back,
but if you rem out the MENU, it works fine, so the error is somewhere in the Menu module code, but I can not find it.
I do use map to create the Menu, it is the only way I could think of to do this, I have a feeling its this code that is causing the issue,
but I do not know a work around.
This Menu system will be great once I find this bug, its Open Source, so you might find it interesting.
The code for this project is here:
[[[https://github.com/WittyWizard/install]]]
Thanks
Jeff Flesher
Replies (2)
RE: Need help finding a bug in menu system - Added by Jeff Flesher about 10 years ago
The Code is posted at this web site:
[[[http://wittywizard.org/]]]
It might say that in the readme, but I should have included this information.
I have a scaled down version I attached as Sub-Menu.zip, it works, the only real change is the database functions, so my guess its in there,
I could integrate that into this example, but the code is not that large, and the function is the same in this project, which is not big.
The CMS works great right now, besides this problem that has been driving me crazy.
Grant you the themes are no where near usable, its just a proof of concept, the css will just change colors for bootstrap,
but the menu is a suckerfish I adapted from many ideas at that time,
but it has one problem that I can not figure out,
mainMenu_->removeStyleClass("nav", true);
this does not remove the nav style, true or false.
I will make a video for this CMS and start a video series that shows how each idea works, so its a concept site,
the idea is to generate support for such a project for a community project to support Wt by providing it with the best CMS,
plus video tutorials on how to use Wt to write this CMS, and how to make it better,
despite how long it took, and the problems I have had, it works,
and its the first CMS I have seen for Wt that does work, even if it has this bug that needs fixing.
You will not that all the data for the menu system is stored in one or more file in the app_root in a folder called db, in a file called menu-db-import.xml,
and the XML files in are a folder called xml, the idea is that it can work with the database or without it (still in work).
Wish I could Edit my last Post.
Thanks
Jeff Flesher
Sub-Menu.zip (20.3 KB) Sub-Menu.zip |
RE: Need help finding a bug in menu system - Added by Jeff Flesher about 10 years ago
I created a small app that uses the CreateMenu function from my main app, it works, so I do not think its in this part of the app, but I still can not figure out why the cookie values change, I can debug it and see that the cookie is set, but chrome and firefox cookie inspectors verified that, yet when I create the menu, it causes this behavior, and I have no idea what is doing it, its like it crashed the session, but I have no indication other then this to think that.
This type of error is hard to find, because its does not crash the program, or even generate messages that would indicate a problem.
Any help would be Great.
Thanks
Jeff Flesher