Radicore Forum - RDF feed
type: channel
description: Fast Uncompromising Discussions. FUDforum will get your users talking.
items: updateSelection cannot extract token
items: Re: updateSelection cannot extract token

updateSelection cannot extract token
type: item
description: Radicore v1.72.0 Apache Version 2.2.21 PHP Version 5.3.8 MySQL Version 5.5.16 1. Use updateSelection with multiple SET like this: function _cm_post_updateRecord ($rowdata, $old_data) { $a = 1; $b = 2; $where = "'{$rowdata['lft']}'<lft AND rgt<'{$rowdata['rgt']}'"; $replace = "lvl='lvl+{$a}', lft='lft+{$b}', rgt='rgt+{$b}'"; this->updateSelection($where, $replace); return $rowdata; } // _cm_post_updateRecord 2. Doing the above will result in: Fatal Error: Cannot extract token from: ', lft='lft+2', rgt='rgt+2'' (# 256). 3. Had to rewrite into something like below in order to avoid this fatal error: function _cm_post_updateRecord ($rowdata, $old_data) { $a = 1; $b = 2; $where = "'{$rowdata['lft']}'<lft AND rgt<'{$rowdata['rgt']}'"; $replace = "lvl='lvl+{$a}'"; this->updateSelection($where, $replace); $replace = "lft='lft+{$b}'"; this->updateSelection($where, $replace); $replace = "rgt='rgt+{$b}'"; this->updateSelection($where, $replace); return $rowdata; } // _cm_post_updateRecord
creator: kong
date: 2012-03-17T06:05:16-00:00

Re: updateSelection cannot extract token
type: item
description: Firstly, if you wish to increment a numeric column you must use "lvl=lvl+1" and not "lvl='lvl+1'". If you enclose the update value in quotes it will be treated as a string. Secondly, I have made some slight code changes in the attached zip file which should help.
creator: AJM
date: 2012-03-17T09:54:35-00:00

Re: updateSelection cannot extract token
type: item
description: Thanks, I will try.
creator: kong
date: 2012-03-18T02:56:33-00:00

Re: updateSelection cannot extract token
type: item
description: Your patch fixed the problem. Thanks.
creator: kong
date: 2012-03-18T09:25:27-00:00

Re: updateSelection cannot extract token
type: item
description: I knew I'd get it right eventually
creator: AJM
date: 2012-03-18T09:40:29-00:00