Skip to main content

Error After Update

More
2 years 9 months ago #357106 by davec
Error After Update was created by davec
-- HikaShop version -- : 5.0.0
-- Joomla version -- : 4.4.1
-- PHP version -- : 8.1.26

Hi

I updated from 5.0 to 5.2 and then had the following error.

call to a member function getargument() on string

This meant I could not access the Joomla home dashboard without the same error.

I have reverted the site back to 5.0 for the time being.

Incidentally I never received a notification to update to Hikashop 5.1 either.

Thanks

David

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

More
2 years 9 months ago #357108 by nicolas
Replied by nicolas on topic Error After Update
Hi,

That's normal, the 5.0.2 was released just a few days after the 5.0.1. We had not activated the update notifications for the 5.0.1 at the time.

Regarding the error, it's hard to say anything like that. Please reproduce the issue after activating the "debug" setting of the Joomla configuration. That way, you'll get the full error message.
There are only two places where a method getArgument is called in HikaShop:
1. In the file administrator/components/com_hikashop/pluginCompatJ4.php there is this code:
Code:
$class = get_class($arguments[0]); if(substr($class, 0, 7) == 'Joomla\\') { .... if(!empty($result)) { $results = $arguments[0]->getArgument('result', []); .... } .... }
So for this call to getArgument to generate this error, it would mean that
Code:
$arguments[0]
is a string. However, if that was the case,
Code:
get_class($arguments[0]);
would return an error first and it would definitely not go inside the
Code:
if(substr($class, 0, 7) == 'Joomla\\') {
and thus the line with getArgument would be called.
So that means that the error can't be from there.
2. In plugins/quickicon/hikashop/hikashop.php there is this code:
Code:
if(!is_null($context) && !is_string($context)) { $resultArray = $context->getArgument('result', []); .... }
For this error to happen there, $context needs to be a string. However, in the line
Code:
if(!is_null($context) && !is_string($context)) {
HikaShop checks that $context is not a string. So again, it shouldn't be possible that this code generates the error.

What this all means is that with that short error message, I don't see what could be the problem. The full error message (with the debug activated) would probably help. However, what's likely is that one of these two files have permissions which prevented the Joomla installer from updating them when HikaShop was updated. So one thing you could check if you're able to reproduce the issue is these pieces of code I provided above and make sure you have the same as me. Chances are that the version of one of these files is not the 5.0.2 (you can see the version number at the beginning of the file) because of this permission issue I talked about. So manually copying the files from the install package via FTP would solve the problem.

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

More
2 years 9 months ago - 2 years 9 months ago #357125 by multigeo
Replied by multigeo on topic Error After Update
Hi Nicholas,
I got the same error and will also revert to 5.0.0
I attached Call Stacks from both Joomla and JoomlaShack ErrorNotify.
Both essentially provide the same info, but there are some small differences.
Hope this will help you in tracking things down.

Another thing: I verified and the correct files have been installed, no old files from v5.0.0 left as you suggested might possibly be the case.

The error seems to be only related to the back end, the front end seems to be working ok, although I have not tried all functions.

Happy hunting :)
Last edit: 2 years 9 months ago by multigeo. Reason: Added attachments

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

More
2 years 9 months ago #357128 by nicolas
Replied by nicolas on topic Error After Update
Hi,

Thanks !
I'm not sure why this is happening. The code shouldn't allow for it.
I've made a patch to reinforce the protection there to avoid the error.
Please try again with the new install package available on our website for the 5.0.2. It should hopefully be enough.
The following user(s) said Thank You: davec

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

More
2 years 9 months ago #357139 by pat01
Replied by pat01 on topic Error After Update
Hi

It's the HikaShop Quickicon plugin causing the error. Disabling it makes the error go away.

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

More
2 years 9 months ago #357141 by davec
Replied by davec on topic Error After Update
I uploaded the patched version and the error was no longer present.

Dave B)
The following user(s) said Thank You: multigeo

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

More
2 years 9 months ago #357143 by nicolas
Replied by nicolas on topic Error After Update
Hi,

We know. That's what the debug provided by @multigeo said. However, the patch I made yesterday should help. Did you try updating to the new build in order to get the patch I've added in the quickicon plugin ?
The following user(s) said Thank You: multigeo, pat01

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

More
2 years 9 months ago #357146 by pat01
Replied by pat01 on topic Error After Update
I downloaded and installed the ZIP package about an hour before I wrote my post. So, the issue was there.

I downloaded and installed it just now again and the issue has gone. The quick icon is working now.

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

More
2 years 9 months ago #357394 by multigeo
Replied by multigeo on topic Error After Update
Same here.
Thanks very much Nicholas!

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

More
2 years 9 months ago #357404 by Seahawk
Replied by Seahawk on topic Error After Update
Had the same error just after installation.

I cleared the cache and then it seems to work fine.
The following user(s) said Thank You: nicolas

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

Time to create page: 0.257 seconds
Powered by Kunena Forum