Error After Update

  • Posts: 440
  • Thank you received: 20
  • Hikashop Essential
11 months 3 weeks ago #357106

-- 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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 months 3 weeks ago #357108

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:

$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
$arguments[0]
is a string. However, if that was the case,
get_class($arguments[0]);
would return an error first and it would definitely not go inside the
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:
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
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.

  • Posts: 26
  • Thank you received: 3
  • Hikashop Business
11 months 2 weeks ago #357125

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 :)

Attachments:
Last edit: 11 months 2 weeks ago by multigeo. Reason: Added attachments

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 months 2 weeks ago #357128

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.

  • Posts: 48
  • Thank you received: 4
  • Hikashop Business
11 months 2 weeks ago #357139

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.

  • Posts: 440
  • Thank you received: 20
  • Hikashop Essential
11 months 2 weeks ago #357141

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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 months 2 weeks ago #357143

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.

  • Posts: 48
  • Thank you received: 4
  • Hikashop Business
11 months 2 weeks ago #357146

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.

  • Posts: 26
  • Thank you received: 3
  • Hikashop Business
11 months 1 week ago #357394

Same here.
Thanks very much Nicholas!

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

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
11 months 1 week ago #357404

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.105 seconds
Powered by Kunena Forum