Jump to content

What do these errors mean?


Claudia M

Recommended Posts

What do these errors mean?  I have a few more but they are basically all the same. Thanks in advance

Error Log

 

[17-Jul-2018 12:50:40 America/Louisville] PHP Warning:  Invalid argument supplied for foreach() in /home/claudias/public_html/classes/ajax.class.php on line 162

 

Entry

 

68.53.117.57  -- [17/Jul/2018:17:50:40 +0100] "GET /admin_xxxxxx.php?_g=xml&type=files&q=list&dir=refrigerator-magnets%2Fgrandmas-babysitting-service-refrigerator-magnet-sign%2F&group=1&product_id=1365 HTTP/1.1" 200 439 "https://www.claudiasbargains.com/admin_xxxxxx.php?_g=products&cat_id=170&sort%5Bproduct_code%5D=ASC&action=edit&product_id=1365" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"

 

Error Log

 

[17-Jul-2018 11:06:30 America/Louisville] PHP Warning:  Invalid argument supplied for foreach() in /home/claudias/public_html/classes/ajax.class.php on line 162

 

Entry

 

68.53.117.57 -- [17/Jul/2018:16:06:30 +0100] "GET /admin_xxxxxx?_g=xml&type=files&q=list&dir=refrigerator-magnets%2Fbetty-boop-cafe-refrigerator-magnet-sign%2F&group=1&product_id=1360 HTTP/1.1" 200 390 "https://www.claudiasbargains.com/admin_xxxxxx.php?_g=products&cat_id=170&sort%5Bproduct_code%5D=ASC&action=edit&product_id=1360" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"

 

HERE IS ANOTHER ONE  -  FRESH FROM THE ERROR LOG SO I AM PRETTY SURE THE ENTRIES ARE CORRECT

ERROR LOG

[17-Jul-2018 14:32:33 America/Louisville] PHP Warning:  Invalid argument supplied for foreach() in /home/claudias/public_html/classes/ajax.class.php on line 162

Entries

68.53.117.57 - - [17/Jul/2018:19:32:33 +0100] "GET /admin_xxxxx.php?_g=xml&type=files&q=list&dir=refrigerator-magnets%2Fgrandma-babysitting-refrigerator-magnet-sign%2F&group=1&product_id= HTTP/1.1" 200 412 "https://www.claudiasbargains.com/admin_xxxxx.php?_g=products&node=index&action=add" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"
68.53.117.57 - - [17/Jul/2018:19:32:33 +0100] "GET /images/icons/image.png HTTP/1.1" 200 516 "https://www.claudiasbargains.com/admin_xxxx/skins/default/js/styles/styles.php?ed026b1d34f209ed0415087c6b2ebb07" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"

 

Link to comment
Share on other sites

It's a bug in the FileManager class. I think it happens most everytime the admin clicks on a folder in the Add/Edit Product, Images and/or Digital tabs' File Picker box.

The end result seems to be satisfactory - you get the list of images/files in that folder - so I suppose it is a low-priority fix.

Link to comment
Share on other sites

12 hours ago, bsmither said:

It's a bug in the FileManager class. I think it happens most everytime the admin clicks on a folder in the Add/Edit Product, Images and/or Digital tabs' File Picker box.

The end result seems to be satisfactory - you get the list of images/files in that folder - so I suppose it is a low-priority fix.

Has it been logged as an issue - might be low priority but @Al Brookbanks cant get it fixed if it is not in the list.  Always beneficial to sort these types of issues out to stop the error_log file filling up with pointless reports

Link to comment
Share on other sites

  • 5 months later...

I know this error is considered a low priority, but it is really annoying.  Everytime I add an image, then product, I get this. True it doesn't cause a problem, but like I said it's really annpying.  Anyway to fix it?

[29-Dec-2018 16:51:52 America/Louisville] PHP Warning:  Invalid argument supplied for foreach() in /home/-----/public_html/classes/ajax.class.php on line 162

[30-Dec-2018 13:17:32 America/Louisville] PHP Warning:  Invalid argument supplied for foreach() in /home/------/public_html/classes/ajax.class.php on line 162

Link to comment
Share on other sites

One more time... the exact version of CubeCart you are using?

Open the file /classes/ajax.class.php to line 162 and let us see what line that is for your installation.

Also, the exact version of PHP you are running. (See admin, PHP Info.)

Link to comment
Share on other sites

That's the line I thought it was, but I cannot make it produce an error. (I have one more test to do.)

The web access log says:

GET /admin_xxxxxx.php
?_g=xml
&type=files
&q=list
&dir=refrigerator-magnets%2Fgrandmas-babysitting-service-refrigerator-magnet-sign%2F
&group=1
&product_id=1365
Refer: action=edit&product_id=1365

GET /admin_xxxxx.php
?_g=xml
&type=files
&q=list
&dir=refrigerator-magnets%2Fgrandma-babysitting-refrigerator-magnet-sign%2F
&group=1
&product_id=
Refer: action=add

I wonder if the dir paths actually exist? (The %2F is a slash character.)

I wonder if PHP 7 changes error reporting a bit.

Link to comment
Share on other sites

This is what I think is happening:

The admin is working its way down through the folders to find the image to assign to a product. Once the admin clicks a folder that, regardless if there are images in that folder, it has no child folders, the code errors. (But, as said earlier, this is of no consequence.)

This edit tests for the condition that throws the error - trying to form a JSON array of sub-folders where there are no sub-folders found.

In /classes/ajax.class.php, near line 162, find:

					foreach ($dirs[$dir] as $parent => $folder) {
						$path = (!empty($dir)) ? '/' : '';
						$json[] = array(
							'type' => 'directory',
							'path' => urldecode($dir.basename($folder).'/'),
							'name' => basename($folder),
						);
					}


Change to:

					if(isset($dirs[$dir])){
						foreach ($dirs[$dir] as $parent => $folder) {
							$path = (!empty($dir)) ? '/' : '';
							$json[] = array(
								'type' => 'directory',
								'path' => urldecode($dir.basename($folder).'/'),
								'name' => basename($folder),
							);
						}
					}

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...