Post by alancheong » Fri Jan 29, 2016 6:14 pm

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.

Newbie

Posts

Joined
Tue Dec 01, 2015 11:18 pm

Post by Randem » Fri Jan 29, 2016 6:48 pm

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/

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by alancheong » Fri Jan 29, 2016 7:20 pm

I visit the link, but it's too complicated for me.

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

Newbie

Posts

Joined
Tue Dec 01, 2015 11:18 pm

Post by daniGo » Fri Jan 29, 2016 7:30 pm

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.

http://www.gombac.si


Active Member

Posts

Joined
Wed Mar 20, 2013 4:49 pm
Location - Slovenia

Post by Randem » Fri Jan 29, 2016 7:31 pm

The only fix is to start over again with the correct procedure and script. that is as simple as it will get...

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by pm-netti » Sat Feb 06, 2016 4:46 pm

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.

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by alancheong » Thu Feb 18, 2016 5:44 am

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.

Newbie

Posts

Joined
Tue Dec 01, 2015 11:18 pm

Post by Randem » Thu Feb 18, 2016 6:20 am

A band-aid on a stab wound...

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am
Who is online

Users browsing this forum: No registered users and 200 guests