VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: marco.azzali.76 on May 22, 2014, 12:29:31 PM

Title: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: marco.azzali.76 on May 22, 2014, 12:29:31 PM
Hi,

I've just migrated my VM site on another host and different domain name; I performed most common post-migration activities already.
Then I updated Joomla from 2.5.17 to 2.5.20 and Virtuemart from 2.0.24 to 2.6.2.
This problem persists, even after completely uninstalling the AIO component and re-installing it:
when I click Update plugin tables in the AIO component ,  it gives me the error "Invalid Token, in UpdateDatabase".

PHP is 5.3.28

Thank you in advance

Marco
Title: Re: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: jenkinhill on May 22, 2014, 13:10:56 PM
There is no need to update the plugin tables at that time, so is not a problem.
Title: Re: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: marco.azzali.76 on May 22, 2014, 13:22:17 PM
Thank you very much for your prompt answer Jenkinhill !

Anyway, can you please provide an explanation of the error, and/or where this table is located ?

I'm a little maniac in these things...

Thank
Marco
Title: Re: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: Milbo on May 22, 2014, 16:15:59 PM
Please go to controllers/updatesmigration.php in the BE (administrator...)

search there for updateDatabase

then replace the function against this one

function updateDatabase(){

$data = JRequest::get('get');
$token = JRequest::getVar($data['token'],false,'post');
if(!$token){
JRequest::setVar($data['token'], '1', 'post');
}
JRequest::checkToken() or jexit('Invalid Token, in ' . JRequest::getWord('task'));

if(!class_exists('com_virtuemartInstallerScript')) require(JPATH_VM_ADMINISTRATOR . DS . 'install' . DS . 'script.virtuemart.php');
$updater = new com_virtuemartInstallerScript();
$updater->update(false);
$this->setRedirect($this->redirectPath, 'Database updated');
}
Title: Re: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: JMJ on May 23, 2014, 10:51:29 AM
Hi Milbo!

tried the trick; didnt work....

Still the same error...
Title: Re: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: Milbo on May 23, 2014, 10:53:07 AM
or use


function updateDatabase(){

vRequest::vmCheckToken();

if(!class_exists('com_virtuemartInstallerScript')) require(JPATH_VM_ADMINISTRATOR . DS . 'install' . DS . 'script.virtuemart.php');
$updater = new com_virtuemartInstallerScript();
$updater->update(false);
$this->setRedirect($this->redirectPath, 'Database updated');
}


Just tested and changed today to our vmCheckToken, which is automatically checking for a token as key and a token set as token=
Title: Re: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: GJC Web Design on May 23, 2014, 11:56:40 AM
hmm - still Invalid Token, in updateDatabase  here

for ...administrator/index.php?option=com_virtuemart_allinone&task=updateDatabase&bb95b3afe2ddd487b78d1603ebca1492=1

oddly doesn't seem to reach function updateDatabase() in administrator/components/com_virtuemart/controllers/updatesmigration.php

if I rename to function updateDatabasexxxx() I still get the Invalid Token, in updateDatabase message

ah --
changed in   administrator/components/com_virtuemart_allinone/admin.virtuemart_allinone.php  ~ line 32

vRequest::vmCheckToken() or jexit('Invalid Token, in ' . JRequest::getWord('task'));
//JRequest::checkToken() or jexit('Invalid Token, in ' . JRequest::getWord('task'));


works now

hmm - not actually checking the token  - vRequest::vmCheckToken() is always false

don't understand the code in vRequest

if (!self::uword($token, false)){  always true - but no idea what it's checking  so vRequest::vmCheckToken() is always false

Title: Re: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: Milbo on May 23, 2014, 17:17:44 PM
vmCheckToken closes the application, if the token was not found or not equal.
Title: Re: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: GJC Web Design on May 23, 2014, 19:19:07 PM
yep - got that far -- but   uword($token, false)  comes back true therefore fails if (!self::uword($token, false)){

what is uword($token, false) doing?

I see it calls filterUword($source,$custom)  but don't get it from there on in
Title: Re: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: Fantastic4 on May 26, 2014, 13:14:38 PM
Hi,
i have the same problem.
Invalid Token, in updateDatabase after update and trying to actualize VM-Plugin Tables.
I tried both solutions as descripted by Milbo but they didn't solve the problem.
So, is there any other solution for the Problem??
Installation parameter: Joomla 2.5.20, VM 2.6.4, PHP 5.319 and MySQL 5.5.28
Thank you
Title: Re: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: GJC Web Design on May 26, 2014, 15:08:50 PM
vRequest::vmCheckToken() or jexit('Invalid Token, in ' . JRequest::getWord('task'));
//JRequest::checkToken() or jexit('Invalid Token, in ' . JRequest::getWord('task'));


it then updates  - all my hack does is bypass the token check
Title: Re: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: marco.azzali.76 on June 01, 2014, 15:50:42 PM
With VM 2.6.6 the problem seems solved for me !  ;)
Title: Re: Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables
Post by: GJC Web Design on June 01, 2014, 16:06:27 PM
Yep - annouced on the 2.6.6 release feed

fixes while updating the tables for the Joomla updater