Loading

nvalid argument supplied

6 posts / 0 new
Last post
Anonymous
nvalid argument supplied

When I try to get a new product Iget this error:

Warning: Invalid argument supplied for foreach() in /home5/mediapre/public_html/... /axis/app/code/Axis/Catalog/Model/Product/Row.php on line 140

Why this error?

Regards,
Dan

Offline
Joined: 10/12/2010

Can you open the file app/code/Axis/Admin/controllers/Catalog/IndexController.php and add these lines:

Axis::message()->addError($this->_getParam('image'));
return $this->_helper->json->sendFailure();

right before the foreach loop (line ~247)

foreach ($jsonParams as $param) {...

Then try to save product again. You will recieve the error message. Post it here please.

Anonymous (not verified)

the error is:

{\"ext-record-8\":{\"path\":\"/i/n/inel_logodna-2.jpeg\",\"sort_order\":50,\"is_thumbnail\":1,\"is_listing\":1,\"is_base\":1,\"remove\":0}}

Offline
Joined: 10/12/2010

Looks like you have magic_qutes option enabled in your server environment.
Disable it and try again to save the product.

Anonymous (not verified)

it was disabled already by htaccess:

##################################

## Disable magic quotes

php_value magic_quotes_gpc off

Offline
Joined: 10/12/2010

Your server is probably running in CGI/FCGI mode, and this statement doesn't affect the environment.

The problem is that params recieved by server are being escaped by backslashes:

{\"ext-record-8\":{\"path\":\"/i/n/inel_logodna-2.jpeg\", ...}}

Param should not contain these backslashes:

{"ext-record-8":{"path":"/i/n/inel_logodna-2.jpeg", ...}}