Page 1 of 1

[NOT BUG:1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Fri Sep 01, 2006 12:43 am
by blindMoe
"Menu Items not removed from jos_menu when deleted from site administration"

We recently updated to Joomla 1.0.11 and when we did, we noticed a big problem.

After upgrading to 1.0.11 and installing on the server we noticed that Open Sef was not correctly sef'ing the URLs for the Hot Properties component.  We dug through all the code involved in hot properties and open sef but to no avail.

We then started digging through the database.  One thing we did know is that Open Sef relies on a menu item linking to a component to let you set a SEF Alias.  Based on this knowledge we looked in jos_menu to see if for some reason there was a problem with the record holding the menu item that linked to Hot Properties.  While looking in that table, we saw that there were old menu items linking to hot properties even though we had deleted those menu items in the admin panel.


OK So after saying all that... here is whats up.  When you create a menu item, and then delete it, Joomla is not removing the reference from the database.  So if you are like us and change your menu a few times before you get it right you end up with a bunch of "ghost" entries in your jos_menu table that should not be there.  This was confusing open sef and essentially causing it to not work with any of the components that were linked to by these "Ghost" entries.

After removing all entries pointing to com_hotproperty we performed a very simple test.

1.  Delete all entries in jos_menu using the mysql client or phpmyadmin that point to a certain component.
2.  Create two new entries using the Joomla Administration web interface.
3.  Go look in your jos_menu table again and you will see the two entries.
4.  Delete one of your menu items using the Joomla Administration web interface.
5.  Look in the jos_menu table using mysql client or phpmyadmin and you will notice that both entries still exist.

This may not cause a problem with Joomla but it is definitely not good to leave the ghost entries in the jos_menu table because many components rely on that table to find active components.

I hope this can be resolved.  If I get some time I will find the error in the code and fix it and will definitely share it with everyone.  I just figured I would explain what happened because it was a very aggravating problem and if anyone else runs into it hopefully they will find this thread.

BUG:  Joomla Administration interface not removing Menu Items from jos_menu when the Menu Item is deleted.


blindMoe

Re: !!! Menu Items not removed from jos_menu when deleted from site administrati

Posted: Fri Sep 01, 2006 10:18 am
by user deleted
[TAGGED: Q&T] Status > Under Review

Re: [UNDER REVIEW: 1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Thu Oct 12, 2006 3:32 pm
by wmena
Why would this be a bug? 

When you Delete/Trash a content or menu item, they are moved to trash so that you can recover them if needed later.  You need to clear the trash to fully remove these entries from the database.

When a menu item is Published, the published flag is set to 1
when a menu item is not published, the published flag is set to 0
when a menu item is trashed, the published item is set to -2

Isn't it the responsibility of the 3rd party component to recognize this?

Re: [UNDER REVIEW: 1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Tue Oct 24, 2006 12:52 pm
by user deleted
Q&T Note; wmena is right, menu items can be trashed, but should not be removed directly from the database. I'm also thinking this might be related to Artifact http://forge.joomla.org/sf/go/artf6074?nav=1 which has now been solved for the next release.

@ blindMoe, could you verify that if you use the latest SVN in combination with your site and OpenSEF, that the problem is solved?

Re: [UNDER REVIEW: 1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Sat Oct 28, 2006 10:00 pm
by RobS
Q&T Note; Changing status> Not Bug

Re: [NOT BUG:1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Tue Nov 14, 2006 2:53 pm
by user deleted
Q&T Note; no response from poster, and RobS already marked this as not bug. Moving to Resolved.

Re: [NOT BUG:1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Wed Mar 21, 2007 12:26 am
by sgt_goomba
Instead of starting a new topic, I'll raise this one from the dead. I know it was listed as Not Bug, but there was no explanation. The behavior is as described above, but again, menu items aren't removed from the database when they are deleted. They are also nowhere to be found in my "trash bin," which is empty. The entries remain in the database (in the table jos_menu) with a published status of -2.

I don't have a problem with it as long as this is normal behavior.

Re: [NOT BUG:1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Wed Mar 28, 2007 5:42 am
by ouija
I second that -- recently, I was using a 3rd party component and it somehow picked up on these "ghost" entries left behind in the jos_menu table of my DB. (they were set to -2 under published)  But still, these were for menu items that I had deleted and emptied from the trash.... so why do they still exist in the DB?  It just makes things somewhat confusing when modules like the one I was using pick up on these entries and can make it difficult for the end user to determine which ones are "deleted" and which ones are not...

It is simple enough to figure out, as well as to delete these entries manually, but still... why is this not considered to be a bug? Just curious :p

Re: [NOT BUG:1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Thu Jun 21, 2007 11:30 pm
by K123
I reopened this bug after having this issue with items that are still published
http://forum.joomla.org/index.php/topic ... #msg871073

Re: [NOT BUG:1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Sat Aug 04, 2007 9:52 am
by christiangibson
I have trashed two menu items, but trash manager shows an empty trash bin. The items are still in jos_menu table with 'published' status set to -2. This would be okay if I could expunge the items from trash bin, but this is not possible. This is surely a bug?

Re: [NOT BUG:1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Sat Aug 04, 2007 7:04 pm
by RobS
Are you selecting menu items in the type box of the trash manager? The default view is to show content items only.  You need to click the drop down on the right and select menu items for it to show you menu items.  Also, which version of Joomla! are you using?

Re: [NOT BUG:1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Sun Aug 05, 2007 8:45 am
by christiangibson
Sorry for my oversight! Of course you are right - I recently discovered my mistake. But would it not be more logical to show all items in the trash bin as default rather than just the content items?

Re: [NOT BUG:1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Sun Aug 05, 2007 9:14 am
by RobS
Yes, it probably would be more logical but this is not something that we are going to change at this point, sorry.

Re: [NOT BUG:1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Mon Oct 01, 2007 5:00 pm
by jsw
Can jos_menu items that display as having been trashed ( -2 in the Published column ) still be visible on the front end? I have been trying to clean up our database and delete all '-2' items, yet in some cases these delete existing (presently being used and published) menu items. Can you explain this?

jsw

Re: [NOT BUG:1.0.11] Menu Items not removed from jos_menu when deleted

Posted: Mon Oct 15, 2007 10:09 pm
by Aquabri
Same issue, have trashed and emptied trash for content and menu items and th ghost entries are still appearing.

FIXED:  it was an issue on SWMENUfree automatically publishing content items as menu items