Jump to content

Cannot Add Images "Error while creating additional image" after upgrade to 1.6.1.1


Recommended Posts

Are you sure the format is really jpg? Is it lower or uppercase?

Many thanks for your reply, Yes the image format is Jpeg.and image name is "Mallorca-white-bed" before it was all upper case then I tried to upload images by changing their name to lower case. but still failed to upload. , and this error started coming 2 weeks ago when I was trying to upload images to a product. and then I added a new user (Employee) in back end, and i signed in with that id, and then I tried. with that new ID I have uploaded 4 images for that product. and it was successful. but next time when i wanted to upload images for another product. this error start Coming and still I cannot find the solution. Please help me to solve this issue.

Many thanks

Edited by adamthomson123 (see edit history)
Link to comment
Share on other sites

I guess that user has enough rights? What about the superadmin one? Also, you could try opening the debug console, fire the upload and keep an eye to the network tab, looking for the upload request's response

One user is super admin, and other user is logician. If You want I can sent you both login details and you can have a look. I am stucked now. can't go ahead until the issue is solved. Please help me to get it solved.

I don't know how to turn on debug console. please help me to open it and get it fixed.

Many thanks

Edited by adamthomson123 (see edit history)
Link to comment
Share on other sites

Sorry, I can't check it directly at the moment. That is just supposed to display the debug console on chrome.

 

Ok Thanks! can you help me with another error, which is 404 error. its keep coming always on back end of my website. how to get rid of this issue? it is too much every time it take too long to resolve. 404 Error. Please help me with that. I cannot add product combinations, i cannot add  more products, it is every where coming.

Many thanks

Edited by adamthomson123 (see edit history)
Link to comment
Share on other sites

When are you getting the 404 exactly?

404 error Comes on 

Whenever i login back end.

whenever i add new product

whenever i add combinations of any product

whenever i edit orders.

and sometimes when customer try to make payment on order page. it gives 404 error, than customer call me and place order over the phone.

whenever I try to send message to customer from back-end, it is always failed to send a message to customer and comes 404 error.

Link to comment
Share on other sites

Very odd, could you ask your hosting company? If you are using friendly urls for the front office, try disabling them and see if it helps, although it should not really interfere. It might as well be mod_security

and why i cannot send messages to the customers from back end? it is also giving error.

will you suggest me to install the fresh prestashop and upload old database in that? will it work and solve all the errors?

I really need help with these issues, as i dont have programming skills.

Link to comment
Share on other sites

It really depends on the issue. You can try to install a whole separate new version first, see how that works (on the same server). If it does, try hooking it up to your old database (given it's the same prestashop version)

After Fresh Install, Shall I copy all the tables with data from old database to new database? hooking means? will it work?

Link to comment
Share on other sites

I just mean connecting. You don't need to copy tables, just modify the database name in config/settings.inc.php so that it is not destructive, and you can always change it back

 Many thanks for your help, I have installed a fresh prestashop and connected the database as you said, everything is fine just there are two errors,

1.  in the top right contact us on front page, that is not working, i am attaching a screenshot of that error, customers cannot send messages through contact us form. Please help me to solve this and 

2. when I click on messages in back end dashboard, it cannot open messages and keep giving 404 error. and Internal Server Error. Screenshot attached. please help me to fix it aswell. Many Many thanks

msg%20error.jpg

 

 

 

back-end-error.jpg

Link to comment
Share on other sites

Is dev mode enabled already?

Please help me to get is sorted, My business is getting affected with these errors now. customer cannot place orders and the complaint about the errors all the time. 

Yes it is enabled, and error comes like this: (This errors comes , when I Click on Orders in Back End, and similar error comes when I click on Messages.).

[PrestaShopDatabaseException]

Unknown column 'id_shop' in 'where clause'

 

SELECT * FROM `ps_ganalytics` WHERE sent = 0 AND id_shop = '1' AND DATE_ADD(date_add, INTERVAL 30 minute) < NOW()

at line 791 in file classes/db/Db.php

 

786. if ($webservice_call && $errno) {

787. $dbg = debug_backtrace();

788. WebserviceRequest::getInstance()->setError(500, '

 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);

789. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {

790. if ($sql) {

791. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');

792. }

793.

794. throw new PrestaShopDatabaseException($this->getMsgError());

795. }

796. }

Edited by adamthomson123 (see edit history)
Link to comment
Share on other sites

It seems the google analytics module is missing a column named id_shop, you need to add it to the database using phpmyadmin

Thanks i have done that and the error on the orders page has been solved. but the other error is still there, when i click on messages in back end > dashboard> messages. it is keep giving 404 error. and i cannot find the solution for that. I have turned on error reporting in defines.inc.php. but nothing comes up. and only comes "404 page not found" i have to many messages from customers to read and reply them and same error comes when I login back end , i always see 404 error and i refresh the page 6, 7 times then i get to the back end. Please help me to solve these errors.

Many Many Thanks

Edited by adamthomson123 (see edit history)
Link to comment
Share on other sites

You might be running out of resources at this point. Check the error log inside prestashop. If nothing pops out, you can ask your hosting to check your server's logs

Thanks for your help,  Following is the Error log from 2nd of October to 4th of October 2015. Please if you can guide me to catch the error. Many Thanks

 
[02-Oct-2015 18:35:57 UTC] PHP Warning:  require_once(/home/brixton/public_html/config/defines.inc.php): failed to open stream: No such file or directory in /home/brixton/public_html/config/config.inc.php on line 33
[02-Oct-2015 18:35:57 UTC] PHP Fatal error:  require_once(): Failed opening required '/home/brixton/public_html/config/defines.inc.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/brixton/public_html/config/config.inc.php on line 33
[02-Oct-2015 18:36:24 UTC] PHP Warning:  require_once(/home/brixton/public_html/config/defines.inc.php): failed to open stream: No such file or directory in /home/brixton/public_html/config/config.inc.php on line 33
[02-Oct-2015 18:36:24 UTC] PHP Fatal error:  require_once(): Failed opening required '/home/brixton/public_html/config/defines.inc.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/brixton/public_html/config/config.inc.php on line 33
[02-Oct-2015 18:58:21 GMT] PHP Fatal error:  Call to undefined method CompareController::getProduct() in /home/brixton/public_html/modules/socialsharing/socialsharing.php on line 161
[02-Oct-2015 18:58:50 GMT] PHP Fatal error:  Call to undefined method CompareController::getProduct() in /home/brixton/public_html/modules/socialsharing/socialsharing.php on line 161
[03-Oct-2015 16:12:56 GMT] PHP Fatal error:  Call to undefined method CompareController::getProduct() in /home/brixton/public_html/modules/socialsharing/socialsharing.php on line 161
[04-Oct-2015 08:47:05 GMT] PHP Fatal error:  Call to undefined method CompareController::getProduct() in /home/brixton/public_html/modules/socialsharing/socialsharing.php on line 161
[04-Oct-2015 10:47:18 GMT] PHP Fatal error:  Call to undefined method CompareController::getProduct() in /home/brixton/public_html/modules/socialsharing/socialsharing.php on line 161
[04-Oct-2015 20:40:12 GMT] PHP Fatal error:  Call to undefined method CompareController::getProduct() in /home/brixton/public_html/modules/socialsharing/socialsharing.php on line 161
[04-Oct-2015 20:40:17 GMT] PHP Fatal error:  Call to undefined method CompareController::getProduct() in /home/brixton/public_html/modules/socialsharing/socialsharing.php on line 161
Link to comment
Share on other sites

I don't have that in my socialsharing module, yours might be newer. I guess it's not compatible with the version you run it on

and when I try to create an order from the cart in back end. following error comes

[PrestaShopException]

Property Order->total_paid is not valid

at line 909 in file classes/ObjectModel.php

904.             }905. 906.             $message = $this->validateField($field, $this->$field);907.             if ($message !== true) {908.                 if ($die) {909.                     throw new PrestaShopException($message);910.                 }911.                 return $error_return ? $message : false;912.             }913.         }914.
  • ObjectModelCore->validateFields - [line 246 - classes/ObjectModel.php]
  • ObjectModelCore->getFields - [line 304 - classes/order/Order.php]
  • OrderCore->getFields - [line 487 - classes/ObjectModel.php]
  • ObjectModelCore->add - [line 309 - classes/order/Order.php] - [2 Arguments]
  • OrderCore->add - [line 341 - classes/PaymentModule.php]
  • PaymentModuleCore->validateOrder - [line 1160 - controllers/admin/AdminOrdersController.php] - [9 Arguments]
  • AdminOrdersControllerCore->postProcess - [line 178 - classes/controller/Controller.php]
  • ControllerCore->run - [line 367 - classes/Dispatcher.php]
  • DispatcherCore->dispatch - [line 58 - admin/index.php]
[PrestaShopException]

Property Order->total_paid is not valid

at line 909 in file classes/ObjectModel.php

904.             }905. 906.             $message = $this->validateField($field, $this->$field);907.             if ($message !== true) {908.                 if ($die) {909.                     throw new PrestaShopException($message);910.                 }911.                 return $error_return ? $message : false;912.             }913.         }914.
  • ObjectModelCore->validateFields - [line 246 - classes/ObjectModel.php]
  • ObjectModelCore->getFields - [line 304 - classes/order/Order.php]
  • OrderCore->getFields - [line 487 - classes/ObjectModel.php]
  • ObjectModelCore->add - [line 309 - classes/order/Order.php] - [2 Arguments]
  • OrderCore->add - [line 341 - classes/PaymentModule.php]
  • PaymentModuleCore->validateOrder - [line 1160 - controllers/admin/AdminOrdersController.php] - [9 Arguments]
  • AdminOrdersControllerCore->postProcess - [line 178 - classes/controller/Controller.php]
  • ControllerCore->run - [line 367 - classes/Dispatcher.php]
  • DispatcherCore->dispatch - [line 58 - admin/index.php]
Link to comment
Share on other sites

I have upgraded from 1.6.0.11 to 1.6.1.1. by clicking on One Click Upgrade Module. and all the upgrade was done, at the end it said 404 error. but when I checked it was upgraded and was showing the version 1.6.1.1.

my customers are complaining about the order process , it is giving error and they cannot make payments. then they call and we process their orders.

Please guide me , how to get access to the messages in the back end, whenever i click on messages, 404 error comes up all the time. and i Have to read more than 35 messages and reply to customers, but i cannot open them.

please help me to solve all these issues.

many thanks

Edited by adamthomson123 (see edit history)
Link to comment
Share on other sites

How to check Database Entries? is there any option available, that I can get back the previous Database before upgrade (If i could install a fresh prestashop and import all the previous data to new database? ( I have tried by connecting the old database with fresh install , but is giving too many errors).? or what do I need to do to solve the errors. customers cannot make payments and they keep complaining all the time, it is effecting the business badly.

I have tried by installing a fresh prestashop 1.6.0.11 and connecting the old database. but still facing many errors. many product's images lost. need to upload images again. Need your suggestion and guide to get the website in perfect condition. i need to take some positive actions asap. please guide me. Many Thanks

Edited by adamthomson123 (see edit history)
Link to comment
Share on other sites

  • 2 months later...

We have at least temporarily solved this by DROPping and editing INDEXes related to "cover" image.

 

1. We DROPped INDEX id_product_cover from ps_image indexes.

2. Also: we set to IGNORE the "cover" field of the INDEX id_image in the ps_image_shop table.

 

This allowed us to upload, but I think you will need to recreate these indexes to get all the functionality to work.

 

We noticed this created a bug (but it all works fine once you know the bug):

     1. The "COVER" checkbox will DELETE that image -- so you can use it for that - Click SAVE and STAY to delete the selected image.

     2. The LAST image you upload will be your COVER image.

      ** All your uploaded images will be marked "Cover" image...

 

Hope that helps someone.

- Dasher

Link to comment
Share on other sites

We have at least temporarily solved this by DROPping and editing INDEXes related to "cover" image.

 

1. We DROPped INDEX id_product_cover from ps_image indexes.

2. Also: we set to IGNORE the "cover" field of the INDEX id_image in the ps_image_shop table.

 

This allowed us to upload, but I think you will need to recreate these indexes to get all the functionality to work.

 

We noticed this created a bug (but it all works fine once you know the bug):

     1. The "COVER" checkbox will DELETE that image -- so you can use it for that - Click SAVE and STAY to delete the selected image.

     2. The LAST image you upload will be your COVER image.

      ** All your uploaded images will be marked "Cover" image...

 

This will set you up for problems with future upgrades.

 

With 1.6.1 PS went to a different way of treating the cover field. In the old setup all images that were not cover had the value "0" for the cover field. In the new setup the value is "NULL". That allows PS to set a unique index on that field. I get the impression that something has gone wrong in your database with the conversion from "0" to "NULL".

Link to comment
Share on other sites

  • 3 months later...
  • 5 weeks later...

I had the same issue. For me the problem was with class Objectmodel.php formatfields function

 

I'm really struggling with this issue now on a site that was uploading images fine and has suddenly stopped. I've reviewed all permissions, applied the suggested MySQL "fixes". Can you elaborate on what changes you made to the "Objectmodel.php formatfields function"?

Link to comment
Share on other sites

First, you need to check that in you ddbb tables value for not cover images is NULL on ps_image and ps_image_shop. For me all the suggested fixes (dropping tables etc..) didn't work.

What I changed on objectmodel.php is function formatfields as this:

 

protected function formatFields($type, $id_lang = null)
	{
		$fields = array();

		// Set primary key in fields
		if (isset($this->id))
			$fields[$this->def['primary']] = $this->id;

		foreach ($this->def['fields'] as $field => $data)
		{
			// Only get fields we need for the type
			// E.g. if only lang fields are filtered, ignore fields without lang => true
			if (($type == self::FORMAT_LANG && empty($data['lang']))
				|| ($type == self::FORMAT_SHOP && empty($data['shop']))
				|| ($type == self::FORMAT_COMMON && (!empty($data['shop']) || !empty($data['lang']))))
				continue;

			if (is_array($this->update_fields))
				if ((!empty($data['lang']) || !empty($data['shop'])) && (empty($this->update_fields[$field]) || ($type == self::FORMAT_LANG && empty($this->update_fields[$field][$id_lang]))))
					continue;

			// Get field value, if value is multilang and field is empty, use value from default lang
			$value = $this->$field;
			if ($type == self::FORMAT_LANG && $id_lang && is_array($value))
			{
				if (!empty($value[$id_lang]))
					$value = $value[$id_lang];
				else if (!empty($data['required']))
					$value = $value[Configuration::get('PS_LANG_DEFAULT')];
				else
					$value = '';
			}
            $purify = (isset($data['validate']) && Tools::strtolower($data['validate']) == 'iscleanhtml') ? true : false;
			// Format field value
			//$fields[$field] = ObjectModel::formatValue($value, $data['type']);
			$fields[$field] = ObjectModel::formatValue($value, $data['type'], false, false, !empty($data['allow_null']));
		}

		return $fields;
	} 
Let me know if you want me to take a look
Link to comment
Share on other sites

Unfortunately this didn't work for me. Can you clarify what you mean by the following? 

 

"First, you need to check that in you ddbb tables value for not cover images is NULL on ps_image and ps_image_shop."

 

If you look at the attached screen none of fields for column cover image is "null". Should I change them all to null?

 

Thanks

post-10323-0-34824800-1461840456_thumb.jpg

Edited by mysterion (see edit history)
Link to comment
Share on other sites

I do not see the

Unfortunately this didn't work for me. Can you clarify what you mean by the following? 

 

"First, you need to check that in you ddbb tables value for not cover images is NULL on ps_image and ps_image_shop."

 

If you look at the attached screen none of fields for column cover image is "null". Should I change them all to null?

 

Thanks

I do not see the attachment. What version of prestashop are you using? Also, can you enable dev mode and try to upload image and tell me the error you are getting?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...