PHP Classes

Update menu item

Recommend this page to a friend!

      myMenuGen  >  All threads  >  Update menu item  >  (Un) Subscribe thread alerts  
Subject:Update menu item
Summary:Cannot update
Messages:6
Author:Lieven Maus
Date:2007-03-29 12:00:42
Update:2007-04-03 14:32:24
 

  1. Update menu item   Reply   Report abuse  
Picture of Lieven Maus Lieven Maus - 2007-03-29 12:00:43
When i click 'submit': 'Database error: unable to update menu item id: 1'

  2. Re: Update menu item   Reply   Report abuse  
Picture of Peter Barkway Peter Barkway - 2007-04-02 09:54:45 - In reply to message 1 from Lieven Maus
Lieven,

Have you checked that your db user has the correct privileges to update records, etc. If so, could you give me a bit more detail as I have doubled checked my installation and cannot replicate the error.

Regards

Peter

  3. Re: Update menu item   Reply   Report abuse  
Picture of Lieven Maus Lieven Maus - 2007-04-02 18:59:16 - In reply to message 2 from Peter Barkway
privileges are ok. When i copy the sql and try to execute in phpMyAdmin
sql:

UPDATE mymenugen_menu_items SET menu_title = 'Menu Item 1', position = 1, parent_id = '', image = '', hr_line = 'no', page_id = 100 WHERE id = '1'

MySql: error 1264, out of range value adjusted for column 'parent_id' at row 1

  4. Re: Update menu item   Reply   Report abuse  
Picture of Peter Barkway Peter Barkway - 2007-04-03 07:54:06 - In reply to message 3 from Lieven Maus
I am using MYSQL client v3.23.49 - my guess is you are using a different version and/or that it is stricter on passing empty strings. Please could you try and add the following to mymenugen_class.php.

Insert at line 302:
if(empty($this->parent_id)) $this->parent_id = 0;

Insert at line 333 (after inserting above):
if(empty($this->parent_id)) $this->parent_id = 0;


This will force the parent to have a value of zero (top level) if none specified. If you could test and let me know I would be very grateful. If this is the case I will work out a tidy answer and post a new version.

Many thanks

Peter

  5. Re: Update menu item   Reply   Report abuse  
Picture of Lieven Maus Lieven Maus - 2007-04-03 13:53:54 - In reply to message 4 from Peter Barkway
I use MySql 5.0. It works now correctly. Thanks very much for the quick answers!

Other (cosmetic :-) ) problems: the icons for 'delete this item', 'insert new line' 'move this item up' and 'move this item down' doens't show. (IE 7.0). In Firefox they don't show up also. And in Firefox the 'tooltips' are not popping up on hovering the field, they just are shown as plain text on the screen, messing up the display.

Thanks for looking at it.

  6. Re: Update menu item   Reply   Report abuse  
Picture of Peter Barkway Peter Barkway - 2007-04-03 14:32:24 - In reply to message 5 from Lieven Maus
Thanks for letting me know. I'll create an upgrade soon with a more tidy fix for the problem, as well as the ones you have pointed out.