Page 1 of 1

Errors in shop Error log

Posted: Wed Aug 07, 2024 8:39 am
by 14Steve14
I am seeing lots of this type of error in the error logs.
[31-Jul-2024 12:18:09 Europe/London] PHP Warning: Undefined array key "manufacturers_seo_description" in /home/####/####/includes/classes/manufacturer.php on line 26
[31-Jul-2024 12:18:09 Europe/London] PHP Warning: Undefined array key "manufacturers_seo_title" in /home/####/####/includes/classes/manufacturer.php on line 26
[31-Jul-2024 12:18:09 Europe/London] PHP Warning: Undefined array key "manufacturers_name" in /home/####/####/includes/classes/manufacturer.php on line 26
[31-Jul-2024 12:18:09 Europe/London] PHP Warning: Undefined array key "manufacturers_image" in /home/####/####/includes/classes/manufacturer.php on line 26
[31-Jul-2024 12:18:09 Europe/London] PHP Warning: Undefined array key "manufacturers_description" in /home/####/####/includes/classes/manufacturer.php on line 26
I have checked the database and all manufacturers seem to have all the correct data added so nothing is missing.

I found a post in another thread which mentioned changing line 26 in includes/classes/manufacturer.php to

Code: Select all

return $this->_data[$key] ?? '';
What does adding the two question marks do, and is it alright to do as I notice that the file in a leter version is still the same as the old one.

Re: Errors in shop Error log

Posted: Wed Aug 07, 2024 8:57 am
by zipurman
14Steve14 wrote: Wed Aug 07, 2024 8:39 am

Code: Select all

return $this->_data[$key] ?? '';
What does adding the two question marks do, and is it alright to do as I notice that the file in a leter version is still the same as the old one.
The code with double question marks means , if first value is defined, use it, otherwise use next value.

So in this example, if $this->_data[$key] is defined, it will be returned. If not, ‘’ is returned.

Re: Errors in shop Error log

Posted: Wed Aug 07, 2024 9:24 am
by burt
Try to locate the page (or in other words, what the customer did) that is causing these errors.
Report back the page name, whether it is core or an addon.

In other words see if you can replicate creating that error.

This is a list of files that uses getData;
brand.jpg
Box -> Manufacturer Info and Schema [when looking at a product]
Breadcrumb, Manufacturer Title & Description and the others [index structure when looking at a manufacturer]

That's about it for Core. You may have addons that use getData.

Re: Errors in shop Error log

Posted: Wed Aug 07, 2024 11:47 am
by 14Steve14
@zipurman Thanks for the explanation.

@burt Gary I will have to do a bit of further testing as I have tried opening and selecting products from all the manufacturers rom the brands navbar module, from within a product, from with a search or from our brands page which is only a page of logs and links.

So far I cannot get any errors to show. Left it for 20 minutes checked the error logs - empty. Just come back to look again and over 20 entries all similar, so customers are doing something.

For now I have turned off the SEO override in the breadcrumb module just to see if that's the cause. I will also keep trying different things myself. I have compared a few of the core files from version 1.0.9.2, when I am using 1.0.9.0 and all seems to be similar no no major changes with those files if others have reported errors.

Re: Errors in shop Error log

Posted: Wed Aug 07, 2024 2:56 pm
by heatherbell
14Steve14 wrote: Wed Aug 07, 2024 8:39 am I am seeing lots of this type of error in the error logs.
Yes, us too (on 1.0.9.0). Tried hard but cannot replicate the customer action. Lots of site visitors with no notices then that string of notices caused by a visitor - maybe the action of a bot?

Re: Errors in shop Error log

Posted: Wed Aug 07, 2024 3:42 pm
by Kofod95
What happens, if you change the manufacturers_id in the URL on product_info to something that does not exist? Could that be it? A cached/saved URL with a now deleted manufacturer?

//Daniel

Re: Errors in shop Error log

Posted: Wed Aug 07, 2024 3:59 pm
by 14Steve14
heatherbell wrote: Wed Aug 07, 2024 2:56 pm
14Steve14 wrote: Wed Aug 07, 2024 8:39 am I am seeing lots of this type of error in the error logs.
Yes, us too (on 1.0.9.0). Tried hard but cannot replicate the customer action. Lots of site visitors with no notices then that string of notices caused by a visitor - maybe the action of a bot?
I am on 1.0.9.0. Glad its not just me. I have tried all sorts and cannot generate the error so have no idea what people are doing.

Following Gary's advice I have searched all the files for getData; and it is not in that many files which may be a help.

I am starting with the breadcrumb module as we don't have any of the box modules installed. I have adjusted the setting in the breadcrumb module just to see it that made any difference and it didn't. I have now uninstalled the module just to see what happens. It has been off for an hour now and still there are errors in the logs so I guess its not that. I removed it rather than just turn it off so it was not present.

I will keep trying at this without altering the code I found further up.

Re: Errors in shop Error log

Posted: Wed Aug 07, 2024 5:32 pm
by 14Steve14
Kofod95 wrote: Wed Aug 07, 2024 3:42 pm What happens, if you change the manufacturers_id in the URL on product_info to something that does not exist? Could that be it? A cached/saved URL with a now deleted manufacturer?

//Daniel
You may be on to something and it would be nice if some else could confirm this.

When I look in the error logs for the time the error is happening, and then compare that to the same time in the Who's Online report in admin, I can see what may be causing the errors. If not them all, most of them.

It seems to be when a page link is entered which is no longer available on the website, or a made up one that does not exist. It does not seem to matter whether it is a product page or a manufacturer page. Some of the failed pages also have oscid at the end of the url.

I am wondering if some of the problem could be caused because we have just updated the website from 1.0.8.11 to 1.0.9.0. We changed the URL rewriter we are using, but feel this may not be the case as some of the old urls that are being tried that cause the error are from manufacturers or products we have not had listed on the website for a long time now.

Re: Errors in shop Error log

Posted: Fri Aug 09, 2024 7:39 am
by 14Steve14
I have altered the code as per the first post which I found elsewhere in this forum and will report back if it stops the errors being shown.

Re: Errors in shop Error log

Posted: Sat Aug 10, 2024 12:19 pm
by 14Steve14
14Steve14 wrote: Fri Aug 09, 2024 7:39 am I have altered the code as per the first post which I found elsewhere in this forum and will report back if it stops the errors being shown.
After a few days, no errors showing in the error logs, so this little change has done its job. Thanks for the help as usual guys.

@heatherbell it may be worth you making this slight change if you are getting lots of the same errors.