Always updates, never inserts

rinogo - January 25, 2008 - 17:03
Project:Nice Primary Menus
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

In the function named nice_primary_menus_form_submit(), the update is always executed, never the insert (else clause). Changing the if clause to "if (isset($delta) && $delta!=NULL) {" causes the insert to be executed. However, even so, it is only called when modifying an existing menu item. This function does not work correctly for new menu items since they don't have a mid yet ($form['mid']).

Moral of the story (to get this module to work):
1. Change the if clause in nice_primary_menus_form_submit() to read "if (isset($delta) && $delta!=NULL) {"
2. Create a menu item under Primary Links. THEN, go back and edit the existing menu item. Only when you select submit on this existing item will the insert be executed appropriately.

(Disclaimer: I could be wrong about all of this; these are just the steps I took to get it working on my own install)

#1

asak - September 29, 2008 - 13:22

I tried this - and it works. i can now see values in 'mid' - but should there be anything in 'delta' ?

This isn't working properly.. but better then before this patch ... ;)

 
 

Drupal is a registered trademark of Dries Buytaert.