Invalid Token, in UpdateDatabase while AIO component >> update plug-in tables

Started by marco.azzali.76, May 22, 2014, 12:29:31 PM

Previous topic - Next topic

marco.azzali.76

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

jenkinhill

There is no need to update the plugin tables at that time, so is not a problem.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

marco.azzali.76

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

Milbo

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');
}
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

JMJ


Milbo

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=
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

GJC Web Design

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

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

vmCheckToken closes the application, if the token was not found or not equal.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Fantastic4

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

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

marco.azzali.76


GJC Web Design

Yep - annouced on the 2.6.6 release feed

fixes while updating the tables for the Joomla updater
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation