Error while editing attributes in hosts/services

User / Community contributed content: modifications, patches, extensions, modules, scripts etc.

Error while editing attributes in hosts/services

Postby topi » Mon Jun 11, 2012 10:40

When editing an attribute (changing visibility from "yes" to "no") i get a infinite loop on function set_attr_order (in nconf/include/functions.php)

Apache error.log shows:
Code: Select all
PHP Notice:  Undefined variable: mode in /usr/share/nconf/include/functions.php on line 141, referer: http://localhost/nconf/modify_attr.php?id=233
...
PHP Notice:  Undefined variable: mode in /usr/share/nconf/include/functions.php on line 141, referer: http://localhost/nconf/modify_attr.php?id=233
PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 512 bytes) in /usr/share/nconf/include/classes/class.NConf_HTML.php on line 36, referer: http://localhost/nconf/modify_attr.php?id=233


In file modify_attr_write2db.php is calling this function in line 299:
Code: Select all
set_attr_order($attr_id, $ordering, $fk_id_class, $old_ordering);


and $ordering and $old_ordering have the same value.

i solved with this change:
Code: Select all
--- /usr/share/nconf-1.3.0-0/include/functions.php.orig   2012-06-11 10:35:55.000000000 +0200
+++ /usr/share/nconf-1.3.0-0/include/functions.php   2012-06-11 10:09:55.000000000 +0200
@@ -121,7 +121,7 @@ function set_attr_order($attr_id, $attr_
         $mode = "up";
     }elseif($old_order < $attr_order){
         $mode = 'down';
-    }
+    }else { return; }
 
     # loop trhu attrs
     do {


So set_attr_order returns if ordering is not changing.
topi
starter
starter
 
Posts: 1
Joined: Mon Jun 11, 2012 10:19

Return to Contributions

Who is online

Users browsing this forum: No registered users and 1 guest

cron