Skip to main content

method_exists(): Argument #1 error as below after Joomla upgrade

2 years 3 months ago #361906 by aspirationimages
-- url of the page with the problem -- : aspirationimages.com
-- HikaShop version -- : 5.1.0
-- Joomla version -- : 5.1.1
-- PHP version -- : 8.2.20
-- Browser(s) name and version -- : Safari 17.5
-- Error-message(debug-mod must be tuned on) -- : method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given

Hi,
After upgrading Joomla to 5.1.1 I am getting error method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given
when trying to access Orders tab in Hikashop as per photo.

Any solution please?
bob

Please Log in or Create an account to join the conversation.

2 years 3 months ago #361909 by nicolas
Hi,

We'll need the full error message to be able to understand what's going on.
Please activate the "debug" setting of the Joomla configuration and try again. You'll then get the full error message on that page.

Please Log in or Create an account to join the conversation.

2 years 3 months ago #361917 by aspirationimages
Thanks. This is what I got.

An error has occurred.
0 method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given
Call Stack
# Function Location
1 () JROOT/administrator/components/com_hikashop/classes/shipping.php:883
2 method_exists() JROOT/administrator/components/com_hikashop/classes/shipping.php:883
3 hikashopShippingClass->getShippingName() JROOT/administrator/components/com_hikashop/classes/shipping.php:823
4 hikashopShippingClass->getAllShippingNames() JROOT/administrator/components/com_hikashop/views/order/tmpl/listing.php:272
5 include() JROOT/libraries/src/MVC/View/HtmlView.php:416
6 Joomla\CMS\MVC\View\HtmlView->loadTemplate() JROOT/administrator/components/com_hikashop/helpers/helper.php:2799
7 hikashopView->loadTemplate() JROOT/libraries/src/MVC/View/HtmlView.php:204
8 Joomla\CMS\MVC\View\HtmlView->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2753
9 hikashopView->display() JROOT/administrator/components/com_hikashop/views/order/view.html.php:30
10 OrderViewOrder->display() JROOT/libraries/src/MVC/Controller/BaseController.php:697
11 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2460
12 hikashopController->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2196
13 hikashopController->listing() JROOT/libraries/src/MVC/Controller/BaseController.php:730
14 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_hikashop/helpers/helper.php:2438
15 hikashopController->execute() JROOT/administrator/components/com_hikashop/hikashop.php:73
16 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
17 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
18 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
19 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:150
20 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:195
21 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:306
22 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:58
23 require_once() JROOT/administrator/index.php:32

Please Log in or Create an account to join the conversation.

2 years 3 months ago #361928 by nicolas
Hi,

Thanks ! That's exactly what I needed.
I don't that the error is linked to the update of Joomla. I think it comes from an update of PHP as well as the use of a shipping plugin for an order of your orders listing which has been disabled or uninstalled.
Change the line:
Code:
if(method_exists($shippingMethod, 'shippingMethods'))
to:
Code:
if(!empty($shippingMethod) && method_exists($shippingMethod, 'shippingMethods'))
in the file administrator/components/com_hikashop/classes/shipping.php and it should prevent this error.
We'll add the change on our end too for the next version of HikaShop.

Please Log in or Create an account to join the conversation.

2 years 3 months ago #361932 by aspirationimages
The following user(s) said Thank You: Philip

Please Log in or Create an account to join the conversation.

Time to create page: 0.082 seconds
Powered by Kunena Forum