Page 1 of 1

function token() undefined

Posted: Fri Jan 29, 2016 6:14 pm
by alancheong
Hi,
after upgrade from 2.0.3 to 2.1.0.2, faced several errors at several files
the error similar as following :

Fatal error: Call to undefined function token() in
/admin/model/user/user.php on line 12

which I need to fix as following

replace the token(9)
to
substr(md5(uniqid(rand(), true)), 0, 9)

to temporary fix the error.

the similar error happened at other files too, example, customer.php.

Kindly advise how can I fix this function token permanently.

Re: function token() undefined

Posted: Fri Jan 29, 2016 6:48 pm
by Randem
Hi alancheong,

You probably used the default "upgrade" script and it does not work properly. this will work better for you - http://www.randemsystems.com/support/op ... n-2-1-0-1/

Re: function token() undefined

Posted: Fri Jan 29, 2016 7:20 pm
by alancheong
I visit the link, but it's too complicated for me.

Do u mind to advise a simple quick fix for this error ?

Re: function token() undefined

Posted: Fri Jan 29, 2016 7:30 pm
by daniGo
Check if in system/helper you have file general.php and inside function token.

If yes, open in system dir file startup.php and look for:

Code: Select all

require_once(DIR_SYSTEM . 'helper/general.php');
If is not here add this line.

Re: function token() undefined

Posted: Fri Jan 29, 2016 7:31 pm
by Randem
The only fix is to start over again with the correct procedure and script. that is as simple as it will get...

Re: function token() undefined

Posted: Sat Feb 06, 2016 4:46 pm
by pm-netti
daniGo wrote:Check if in system/helper you have file general.php and inside function token.

If yes, open in system dir file startup.php and look for:

Code: Select all

require_once(DIR_SYSTEM . 'helper/general.php');
If is not here add this line.
Or your need update all system files to OC version 2.1.0.x.

Re: function token() undefined

Posted: Thu Feb 18, 2016 5:44 am
by alancheong
daniGo wrote:Check if in system/helper you have file general.php and inside function token.

If yes, open in system dir file startup.php and look for:

Code: Select all

require_once(DIR_SYSTEM . 'helper/general.php');
If is not here add this line.

Hi, thanks a lot, this fix the issue.

Re: function token() undefined

Posted: Thu Feb 18, 2016 6:20 am
by Randem
A band-aid on a stab wound...