Post by ru-lefthanded » Fri Jul 09, 2021 1:06 am

Earlier today I tried to install a vqmod extension. This failed so I installed the free vqmod installer that shows up on the installer list (sorry cant access the admin to tell you which one). When that installed I lost access to the main admin page (where you can clear cache / look at the version info, etc ) & then when I closed that page & tried to log in, I got the above error message & am no longer able to access the admin side of things at all. I have a number of extensions downloaded & cannot remember all of them - and as I cannot access the admin side of things, I cant disable / delete anything to try to work out where the problem lies.

Given the error message, not sure if this is relevant or not - we have an extension that shows the number of products / categories that are in use etc ( product-category-analysis-on-dashboard.3x.ocmod ) - that displayed on the main admin page as well but of course cannot see that now either. Dont know how to delete /disable this without access to admin!

I tried clearing the vqmod cache via FTP, not resolved.

I had copied all the files over to my hard drive before doing making the above changes - and have tried deleting all the server files & replacing with the ones from my hard drive - not solved.

I have used the Softalicious upgrade tool to upgrade from 3.02 to the latest version - still not resolved.

Error message now is: Undefined property: Proxy::getTotalQuantity in system/engine/action.php on line 79
before upgrading it ended vqmod/vqcache/vq2-system_engine_action.phphp on line 79

Can you please help me resolve this very frustrating situation & I am at a loss for what else to try & do not want to go down the route of a fresh install because of the number of extensions that are in use (some of which include bespoke mods).

Apologies in advance if I have missed any information off here


VQmod file is as follows:
<?php
/**
* @package OpenCart
* @author Daniel Kerr
* @copyright Copyright (c) 2005 - 2017, OpenCart, Ltd. (https://www.opencart.com/)
* @license https://opensource.org/licenses/GPL-3.0
* @link https://www.opencart.com
*/

/**
* Action class
*/
class Action {
private $id;
private $route;
private $method = 'index';

/**
* Constructor
*
* @param string $route
*/
public function __construct($route) {
$this->id = $route;

$parts = explode('/', preg_replace('/[^a-zA-Z0-9_\/]/', '', (string)$route));

// Break apart the route
while ($parts) {
$file = DIR_APPLICATION . 'controller/' . implode('/', $parts) . '.php';

if (is_file($file)) {
$this->route = implode('/', $parts);

break;
} else {
$this->method = array_pop($parts);
}
}
}

/**
*
*
* @return string
*
*/
public function getId() {
return $this->id;
}

/**
*
*
* @param object $registry
* @param array $args
*/
public function execute($registry, array $args = array()) {
// Stop any magical methods being called
if (substr($this->method, 0, 2) == '__') {
return new \Exception('Error: Calls to magic methods are not allowed!');
}

$file = DIR_APPLICATION . 'controller/' . $this->route . '.php';
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);

// Initialize the class
if (is_file($file)) {
include_once(\VQMod::modCheck($file));

$controller = new $class($registry);
} else {
return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
}

$reflection = new ReflectionClass($class);

if ($reflection->hasMethod($this->method) && $reflection->getMethod($this->method)->getNumberOfRequiredParameters() <= count($args)) {
return call_user_func_array(array($controller, $this->method), $args);
} else {
return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
}
}
}

The file in system/engine/action.php is as follows:

<?php
/**
* @package OpenCart
* @author Daniel Kerr
* @copyright Copyright (c) 2005 - 2017, OpenCart, Ltd. (https://www.opencart.com/)
* @license https://opensource.org/licenses/GPL-3.0
* @link https://www.opencart.com
*/

/**
* Action class
*/
class Action {
private $id;
private $route;
private $method = 'index';

/**
* Constructor
*
* @param string $route
*/
public function __construct($route) {
$this->id = $route;

$parts = explode('/', preg_replace('/[^a-zA-Z0-9_\/]/', '', (string)$route));

// Break apart the route
while ($parts) {
$file = DIR_APPLICATION . 'controller/' . implode('/', $parts) . '.php';

if (is_file($file)) {
$this->route = implode('/', $parts);

break;
} else {
$this->method = array_pop($parts);
}
}
}

/**
*
*
* @return string
*
*/
public function getId() {
return $this->id;
}

/**
*
*
* @param object $registry
* @param array $args
*/
public function execute($registry, array $args = array()) {
// Stop any magical methods being called
if (substr($this->method, 0, 2) == '__') {
return new \Exception('Error: Calls to magic methods are not allowed!');
}

$file = DIR_APPLICATION . 'controller/' . $this->route . '.php';
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);

// Initialize the class
if (is_file($file)) {
include_once($file);

$controller = new $class($registry);
} else {
return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
}

$reflection = new ReflectionClass($class);

if ($reflection->hasMethod($this->method) && $reflection->getMethod($this->method)->getNumberOfRequiredParameters() <= count($args)) {
return call_user_func_array(array($controller, $this->method), $args);
} else {
return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
}
}
}

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by straightlight » Fri Jul 09, 2021 1:30 am

The issue you're addressing has nothing to do with the action engine. It has to do with an installed extension that you left installed prior to run the upgrade without consulting the extension developer specifically. Therefore, since you seem to be having a hard time with your installed extensions, you could simply disable the VQMod XML file of those specific extensions under your vqmod/xml folder and clear your VQMod cache files (including those in the root VQMod folder), then to contact the extension developer to resolve this issue.

Alternatively, if the upgrade process has failed entirely, you could either create a new service request in the Commercial Support section of the forum, or contact me directly via the forum PM, to get this done as a custom job.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ru-lefthanded » Fri Jul 09, 2021 9:18 pm

Removed all xml files, cleared vqcache & cleared all browser cache - still get the same message:
Notice: Undefined property: Proxy::getTotalQuantity in.... /system/engine/action.php on line 79
Notice someone else had the same issue (https://forum.opencartbrasil.com.br/vie ... hp?t=18136) and the solution there didnt work either.

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by straightlight » Fri Jul 09, 2021 9:33 pm

ru-lefthanded wrote:
Fri Jul 09, 2021 9:18 pm
Removed all xml files, cleared vqcache & cleared all browser cache - still get the same message:
Notice: Undefined property: Proxy::getTotalQuantity in.... /system/engine/action.php on line 79
Notice someone else had the same issue (https://forum.opencartbrasil.com.br/vie ... hp?t=18136) and the solution there didnt work either.
Possibly originating from OCMod rather than VQMod unless core files were non-supposedly modified directly.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Fri Jul 09, 2021 11:21 pm

You could try searching all the .php and .xml file and the modifications table for "getTotalQuantity". This might help you find the modification causing the issue.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by ru-lefthanded » Sun Jul 11, 2021 5:44 pm

Having downlaoded it to the hard drive ran searches on both the backup & the one that falls over - nothing there
However, have found it in product-category-analysis-on-dashboard.3x.ocmod which is the extension that failed just before I lost access to admin.
Guess I need to remove the files that the extension uploaded but not sure if that will cause other issues!

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by ADD Creative » Sun Jul 11, 2021 6:09 pm

ru-lefthanded wrote:
Sun Jul 11, 2021 5:44 pm
Having downlaoded it to the hard drive ran searches on both the backup & the one that falls over - nothing there
However, have found it in product-category-analysis-on-dashboard.3x.ocmod which is the extension that failed just before I lost access to admin.
Guess I need to remove the files that the extension uploaded but not sure if that will cause other issues!
If it's an OCMOD check that storage/modifications has been cleared. Check the location of your storage folder by checking what DIR_STORAGE is set to in your config.php.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by JNeuhoff » Mon Jul 12, 2021 12:38 am

If it is a proper extension you should be able to run the extension's uninstall, if it is a module. And then, in the admin's Extensions > Installer, simply click on its Uninstall, this will remove all of the extension's files. Then do a Extensions > Modifications > Refresh.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by ru-lefthanded » Mon Jul 12, 2021 2:06 am

JNeuhoff wrote:
Mon Jul 12, 2021 12:38 am
If it is a proper extension you should be able to run the extension's uninstall, if it is a module. And then, in the admin's Extensions > Installer, simply click on its Uninstall, this will remove all of the extension's files. Then do a Extensions > Modifications > Refresh.
Unfortunately as I cannot get past the log in page without getting the error message, I have no ability to access the usual uninstall options.
There is no uninstall routine in the original extension file download (product-category-analysis-on-dashboard.3x.ocmod) - just an install.xml file & the upload folder.

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by ADD Creative » Mon Jul 12, 2021 2:42 am

ru-lefthanded wrote:
Mon Jul 12, 2021 2:06 am
Unfortunately as I cannot get past the log in page without getting the error message, I have no ability to access the usual uninstall options.
There is no uninstall routine in the original extension file download (product-category-analysis-on-dashboard.3x.ocmod) - just an install.xml file & the upload folder.
Clearing the contents of storage/modifications and then clearing the vQmod cache should remove any changes made by the OCMOD.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by ru-lefthanded » Mon Jul 12, 2021 5:29 pm

Thanks for all the suggestions. Really frustratingly, unfortunately, none have cleared the problem.

Can find no way to remove that extension at the moment.

Just need to be able to get into admin screen so that I can then remove some programmes "properly"

I also assume the extension modified the action.php file - copying this into excel it appears that the error is coming from one of the 2 highlighted rows below - probably the 2nd one. Can I comment out some of the lines so that hopefully I can actually get past this? - if so
1) How do I comment out the lines
2) Which line (s) do I comment out

}

$file = DIR_APPLICATION . 'controller/' . $this->route . '.php';
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);

// Initialize the class
if (is_file($file)) {
include_once($file);

$controller = new $class($registry);
} else {
return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
}

$reflection = new ReflectionClass($class);

if ($reflection->hasMethod($this->method) && $reflection->getMethod($this->method)->getNumberOfRequiredParameters() <= count($args)) {
return call_user_func_array(array($controller, $this->method), $args);

} else {
return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
}
}
}

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by straightlight » Mon Jul 12, 2021 5:32 pm

ru-lefthanded wrote:
Mon Jul 12, 2021 5:29 pm
Thanks for all the suggestions. Really frustratingly, unfortunately, none have cleared the problem.

Can find no way to remove that extension at the moment.

Just need to be able to get into admin screen so that I can then remove some programmes "properly"

I also assume the extension modified the action.php file - copying this into excel it appears that the error is coming from one of the 2 highlighted rows below - probably the 2nd one. Can I comment out some of the lines so that hopefully I can actually get past this? - if so
1) How do I comment out the lines
2) Which line (s) do I comment out

}

$file = DIR_APPLICATION . 'controller/' . $this->route . '.php';
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);

// Initialize the class
if (is_file($file)) {
include_once($file);

$controller = new $class($registry);
} else {
return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
}

$reflection = new ReflectionClass($class);

if ($reflection->hasMethod($this->method) && $reflection->getMethod($this->method)->getNumberOfRequiredParameters() <= count($args)) {
return call_user_func_array(array($controller, $this->method), $args);

} else {
return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
}
}
}
Server cache issue. FAQ: viewtopic.php?f=134&t=215776#p731004

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Mon Jul 12, 2021 8:07 pm

ru-lefthanded wrote:
Mon Jul 12, 2021 5:29 pm
Thanks for all the suggestions. Really frustratingly, unfortunately, none have cleared the problem.

Can find no way to remove that extension at the moment.

Just need to be able to get into admin screen so that I can then remove some programmes "properly"

I also assume the extension modified the action.php file - copying this into excel it appears that the error is coming from one of the 2 highlighted rows below - probably the 2nd one. Can I comment out some of the lines so that hopefully I can actually get past this? - if so
1) How do I comment out the lines
2) Which line (s) do I comment out

}

$file = DIR_APPLICATION . 'controller/' . $this->route . '.php';
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);

// Initialize the class
if (is_file($file)) {
include_once($file);

$controller = new $class($registry);
} else {
return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
}

$reflection = new ReflectionClass($class);

if ($reflection->hasMethod($this->method) && $reflection->getMethod($this->method)->getNumberOfRequiredParameters() <= count($args)) {
return call_user_func_array(array($controller, $this->method), $args);

} else {
return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
}
}
}
Commenting out those lines will stop all actions being called, so will not help you. The error is telling you that something is trying to call a method of the name getTotalQuantity, but it doesn't exist. You need to find where getTotalQuantity is called or defined. You need to look not just in the core files, but also in the vQmod cache, the storage/modifications folder, the modifications table in the database and the event table in the database.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by OSWorX » Mon Jul 12, 2021 8:25 pm

Reading all message, I can see only that after 4 days no solution is given.
Which means: 4 days for nothing!

Why not installing the shop completely new and add your template (if a custom is used) - either seperate server or subfolder (leave the original untouched!).
Then make a copy of the database tables (only content) without the settings table (countries also not needed) and import that into the new shop (which has a seperate database of course).
Doing so, will need not more than 1 hour - and your shop is running.

If you want (and need them), you can install then all extensions which worked before - one after one.
And check after each install if the shop is still working.

p.s.: and FORGET VQMod!

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by ru-lefthanded » Mon Jul 12, 2021 11:27 pm

OSWorX wrote:
Mon Jul 12, 2021 8:25 pm
Reading all message, I can see only that after 4 days no solution is given.
Which means: 4 days for nothing!

Why not installing the shop completely new and add your template (if a custom is used) - either seperate server or subfolder (leave the original untouched!).
Then make a copy of the database tables (only content) without the settings table (countries also not needed) and import that into the new shop (which has a seperate database of course).
Doing so, will need not more than 1 hour - and your shop is running.

If you want (and need them), you can install then all extensions which worked before - one after one.
And check after each install if the shop is still working.

p.s.: and FORGET VQMod!
As I have a sizeable number of extensions installed & some are bespoke mods, I'd prefer to find a way to get this going without going down this route.

You are right however in that none of the solutions offered so far have worked

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by ru-lefthanded » Mon Jul 12, 2021 11:44 pm

ADD Creative wrote:
Mon Jul 12, 2021 8:07 pm
ru-lefthanded wrote:
Mon Jul 12, 2021 5:29 pm
Thanks for all the suggestions. Really frustratingly, unfortunately, none have cleared the problem.

Can find no way to remove that extension at the moment.

Just need to be able to get into admin screen so that I can then remove some programmes "properly"

I also assume the extension modified the action.php file - copying this into excel it appears that the error is coming from one of the 2 highlighted rows below - probably the 2nd one. Can I comment out some of the lines so that hopefully I can actually get past this? - if so
1) How do I comment out the lines
2) Which line (s) do I comment out

}

$file = DIR_APPLICATION . 'controller/' . $this->route . '.php';
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);

// Initialize the class
if (is_file($file)) {
include_once($file);

$controller = new $class($registry);
} else {
return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
}

$reflection = new ReflectionClass($class);

if ($reflection->hasMethod($this->method) && $reflection->getMethod($this->method)->getNumberOfRequiredParameters() <= count($args)) {
return call_user_func_array(array($controller, $this->method), $args);

} else {
return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
}
}
}
Commenting out those lines will stop all actions being called, so will not help you. The error is telling you that something is trying to call a method of the name getTotalQuantity, but it doesn't exist. You need to find where getTotalQuantity is called or defined. You need to look not just in the core files, but also in the vQmod cache, the storage/modifications folder, the modifications table in the database and the event table in the database.
get total quantity is from the extension I mentioned earlier in the post. It's really frustrating that there is no simple process to delete an extension via FTP for issues such as this. On the main pages, Vqmod cache is empty & storage/modification is empty save for index.html.
There are also a number of files in the opencart data folder
1) Loads of files in the storage/cache section

2) Error messages there:
2021-07-07 10:32:06 - PHP Warning: unlink storage/cache/cache.catalog.language.1625657443): No such file or directory in system/library/cache/file.php on line 68
2021-07-07 11:08:48 - PHP Notice: Undefined index: info in /storage/modification/admin/model/localisation/currency.php on line 60
2021-07-07 14:35:05 - PHP Notice: Undefined index: info in /storage/modification/admin/model/localisation/currency.php on line 60
2021-07-07 14:41:25 - PHP Warning: unlink(/cache/cache.catalog.language.1625672378): No such file or directory in / system/library/cache/file.php on line 68
2021-07-08 9:49:09 - PHP Notice: Undefined index: info in /home/ethomasl/ocartdataNewALH/storage/modification/admin/model/localisation/currency.php on line 60
2021-07-08 13:31:12 - PHP Warning: unlink(/storage/cache/cache.order_status.1.1625749870): No such file or directory in /system/library/cache/file.php on line 17
2021-07-08 13:49:12 - PHP Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in / admin/controller/marketplace/marketplace.php on line 871
2021-07-08 13:49:12 - PHP Warning: file_get_contents(https://opencart-extension.s3.amazonaws ... cessKeyId= &amp;Expires= Signature= failed to open stream: no suitable wrapper could be found in /controller/marketplace/marketplace.php on line 871
2021-07-08 13:49:13 - PHP Warning: unlink(/storage/upload/rGvSywUUrk.tmp): No such file or directory in / /admin/controller/marketplace/install.php on line 71
2021-07-10 9:55:10 - PHP Notice: Undefined index: enquiry in / catalog/controller/information/contact.php on line 153

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by ru-lefthanded » Tue Jul 13, 2021 1:16 am

OK, so the final solution ended up being (assuming you have a back up to hand)

In Public HTML:
1) Delete the vqmod/vqcache contents
2) Delete the contents of xml folder in vqmod
3) Empty system/ storage/modifications except for index.html
3) Empty system/storage/cache
4) Remove the files uploaded by the original extension

In the opencart Data folder (for the benefit of other newbies, this is the one that is NOT in public html)
5) Empty data/storage/modifications except for index.html

Log back in & make sure you can admin page. Log out

Copy xml files back in from your back up

Log back in, and re-enable any extensions that were switched off - one by one & make sure everything still works as you do this!

Thanks to all who helped me get to this point.

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am
Who is online

Users browsing this forum: No registered users and 139 guests