Hey Casey,

How to reproduce:

  1. Create new menu item with any path
  2. Go to menu listing
  3. Reorder menu items and hit save

You will see that all menu items with any path are deleted. Most obviously it happens because validation runs upon form submission and looks like it fails.

Cheers!

Comments

caseyc’s picture

Very interesting. I'm not sure I agree with your diagnosis. It looks like it's simply resetting the 'external' link to 0 in the menu_item table and because there's not a valid path it's not showing up. Just an interesting byproduct of what we're doing with the module.

I'll dig in and figure out what is doing this to see if we can re-set the menu_item entry to external = 1 with some hook somewhere.

caseyc’s picture

Status: Needs work » Fixed

This is resolved in the 7.x-1.1 release!

caseyc’s picture

Status: Fixed » Closed (fixed)
caseyc’s picture

Issue summary: View changes

Typo fixed

  • Commit fc1847c on 7.x-1.x, query-params by caseyc:
    Issue #1851824 by caseyc: updating external field for menus to '1' when...
njbarrett’s picture

This bug appears to be occurring in 7.x-1.dev now

tisteegz’s picture

Version: 7.x-1.0 » 7.x-1.5
Issue summary: View changes
Status: Closed (fixed) » Active

I am currently using 7.x-1.5 and am experiencing this issue.

I created 20 menu links and the parent menu item had no path validation selected. When I created a second parent menu item and re arranged them I lost all my menu items.

This is quite a serious issue so I am changing the status.

wizonesolutions’s picture

Title: Menu items are automatically deleted after reordering » Menu items disappaer after reordering
Version: 7.x-1.5 » 7.x-1.x-dev
Related issues: +#2237615: External links are converted to internal links
StatusFileSize
new0 bytes

This was introduced in #2237615: External links are converted to internal links. @hanoii removed the functions that dealt with ensuring Any Menu Path items didn't lose their external status during reorders. I have restored the code, am attaching the patch, and am committing it.

  • wizonesolutions committed 1cae7e4 on 7.x-1.x
    Issue #1851824 by wizonesolutions, caseyc: Menu items disappaer after...
wizonesolutions’s picture

Status: Active » Fixed
wizonesolutions’s picture

Also, @tisteegz, please open follow-up issues when the issue you're looking at has been re-introduced in a later version. You can add the old issue as a related lssue link.

wizonesolutions’s picture

Status: Fixed » Needs work

Gotta add an update hook to fix menu items that got broken.

wizonesolutions’s picture

Status: Needs work » Fixed
StatusFileSize
new1.78 KB

The actual path (also committed).

alext77’s picture

hi,

I tried the dev version, but the links still disappear after submit.

I think it's because the new submit function is not called since it's commented :

/**
 * Implements hook_form_menu_overview_form_alter().
 */
function any_menu_path_form_menu_overview_form_alter(&$form) {
//  $form['#submit'][] = 'any_menu_path_form_menu_overview_submit';
}
thihathit’s picture

Status: Fixed » Needs work

Still happening on both dev and release.

wizonesolutions’s picture

Yikes, sorry about that. I was testing the fix but committed it that way. Going to do another release, so check soon.

wizonesolutions’s picture

Status: Needs work » Fixed
gregra’s picture

Still happening for me on version 1.6 (Drupal version 7.40). This works for newly created content.

wizonesolutions’s picture

@gregra Yeah, you probably already ran update.php. It will fix the existing content if you run this query and then run it again:

UPDATE system SET schema_version = 7100 WHERE name='any_menu_path' AND type='module'

Status: Fixed » Closed (fixed)

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

briantbailey’s picture

I recently ran into this bug on a site we are building and I was using the latest release of this module. I thought the bug still existed even though this tread seemed to say it was fixed. I did some additional testing and research and found out the problem was happening due to a conflict with another module I was using, Big Menu (bigmenu). I was able to patch the Any Menu Path module to work with the Big Menu module. All I had to do was add another implementation of hook_form_FORM_ID_alter to add the same submit handler that is in the any_menu_path_form_menu_overview_form_alter implementation. I added any_menu_path_form_bigmenu_overview_form_alter right below the existing hook with the same exact code. This fixed the problem. I have tested this update with both Big Menu enabled and disabled and Any Menu Path works as expected in both cases now. I thought I would provide this comment and patch in case anyone in the future runs into this problem or if the module maintainer thinks it should be committed to the main release.