I created two menus for a group. I ended up not needing the first one (default menu), so I went into the menu system and deleted it. Now, when I try to edit the second menu, I get this error:

The menu name cannot begin with "menu-".

CommentFileSizeAuthor
#1 og_menu-882546.patch1.44 KBjide
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jide’s picture

Status: Active » Needs review
FileSize
1.44 KB

The patch from #754900: OG Menu names that start with menu- don't get associated with the group was a bad idea.
Here is a patch that should solve this issue while allowing to create menu beginning with "menu-".

jaarong’s picture

Thanks jide, after looking through the issues here, I assumed it had something to do with the fix of that bug. Thanks again, this was really in the nick of time for this project that I'm working on. I haven't applied it yet, but I'll test today and report back any errors.

jide’s picture

Status: Needs review » Fixed

The patch has been committed to CVS.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jaarong’s picture

Status: Closed (fixed) » Active

This bug has come up again on my site. I actually probably haven't used OG Menu since the 2.4 update, so I'm guessing that is what caused it since applying the patch fixed it for me.

jaarong’s picture

Version: 6.x-2.3 » 6.x-2.4

Version update, I'm using 2.4

jaarong’s picture

Was this patch taken back out of CVS? Because after upgrading to the latest version, I had to reapply the patch to fix my problem.

ñull’s picture

The error goes further then the described

The menu name cannot begin with "menu-".

I applied the patch and try to delete and now it says:

The menu name can't be longer than 27 characters.

It does not allow me to ename the menu in order to make it shorter. This should be an error message before you create the menu, not after it is already created.

jide’s picture

Sorry everyone for not being very active lately. I will have a look at recent issues. Something went wrong with CVS releases I guess, those issues should have been fixed, I'll have a look at this soon.

geerlingguy’s picture

Running into this issue here, too... won't let me edit or delete any menus used by OG Menu module.

ñull’s picture

bump

The 27 character bug is a Drupal core bug reported here and fixed in the dev version. Release 6.21 should have it fixed. That would mean that the proposed patch here is valid and fixing the other issue. Please apply and release.

jvieille’s picture

Status: Active » Patch (to be ported)

The bug is still there, looks like the patch is not yet applied.
However most of the stuf in the patch is no longer relevant.
I made it working properly by just changing this line:

 function og_menu_edit_menu_form_submit_redirect($form, &$form_state) {
   $node = menu_get_object('node', 1);
   if ($form['#insert']) {
@@ -408,7 +401,7 @@ function og_menu_edit_menu_form_submit($
   $menu_name = $form_state['values']['menu_name'];
   $gid = $form_state['values']['og_menu_gid'];
   // Add 'menu-' if this is a new menu
-  if (strpos($menu_name, 'menu-') === FALSE) {
+  if ($form['#insert']) {
     $menu_name = 'menu-'. $menu_name;
   }
   og_menu_update_menu($menu_name, $gid);

I think this is tested and reviewed since 2 years. Please committ!

Edit: the patch works perfectly!

fuerst’s picture

Version: 6.x-2.4 » 6.x-2.x-dev
Status: Patch (to be ported) » Reviewed & tested by the community

Patch #1 is not in the 6.x-2.x-dev branch but works well there.

pfrenssen’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (outdated)

Closing, since the Drupal 6 version of OG Menu is no longer supported. If this issue is still relevant for the currently supported versions (D7 and D8) then feel free to update the version and reopen the issue.