Jump to content

Bug in Prestashop 1.5.6.1 upgrade


Recommended Posts

There's a bug in the upgrade script that will not copy all of your orders.

 

  • Edit 'install/upgrade/upgrade/php/migrate_orders.php'
  • move lines [spam-filter]92 to line 73, to be before the 'for' loop
  • comment line 93

 

THESE CHANGES NEED TO BE DONE BEFORE STARTING THE UPGRADE SCRIPT, OTHERWISE THE OLD VERSION HAS TO BE RESTORED FIRST AND RUN THE UPGRADE SCRIPT AGAIN.

 

Regards.

Robin.

The CartExpert Team

Edited by CartExpert.net (see edit history)
  • Like 2
Link to comment
Share on other sites

Thanks for help.

I have the same problem, after upgrade from 1.4.9 to 1.5.6.1, i have only 8 orders left.

But i donțt understand what line can i edit.

This is my migrate_orders.php.

from line 68 to line 98.

$step = 3000;
	$count_orders = Db::getInstance()->getValue('SELECT count(id_order) FROM '._DB_PREFIX_.'orders');
	$nb_loop = $start = 0;
	if($count_orders > 0)
		$nb_loop = ceil($count_orders / $step);
	for($i = 0; $i < $nb_loop; $i++)
	{
		$order_res = Db::getInstance()->query('SELECT * FROM `'._DB_PREFIX_.'orders` LIMIT '.(int)$start.', '.(int)$step);
		$start = intval(($i+1) * $step);
		$cpt = 0;
		$flush_limit = 200;
		while ($order = Db::getInstance()->nextRow($order_res))
		{
			$sum_total_products = 0;
			$sum_tax_amount = 0;
			$default_group_id = mo_getCustomerDefaultGroup((int)$order['id_customer']);
			$price_display_method = mo_getPriceDisplayMethod((int)$default_group_id);
			$order_details_list = Db::getInstance()->query('
			SELECT od.*
			FROM `'._DB_PREFIX_.'order_detail` od
			WHERE od.`id_order` = '.(int)$order['id_order']);
			while ($order_details = Db::getInstance()->nextRow($order_details_list))
			{
				$values_order_detail = array();
				$values_order = array();
				$col_order_detail = array();
				// we don't want to erase order_details data in order to create the insert query
				$products = mo_setProductPrices($order_details, $price_display_method);
				$tax_rate = 1 + ((float)$products['tax_rate'] / 100);
				$reduction_amount_tax_incl = (float)$products['reduction_amount'];
	 
  • Like 1
Link to comment
Share on other sites

Such a critical bug, have they stopped the 1 click upgrade till this is fixed ?

 

Hi,

 

This is fixed in the installer

 
 
You do not need to report that, please use the upgrade module which fixes that on the fly during an upgrade to 1.5.6.1
 
 
Best regards
  • Like 1
Link to comment
Share on other sites

I have manually counted , and i seem to have all my orders migrated. I have migrated in Dec. I went through them manually.

 

Also, considering the github changes, it seems the last commits were 2 months ago, and this thread is made in December. Is it possible, some upgrades were made when 1.5.6.1 was released, around Nov 18 maybe.

 

Pete, can you see what is the version number of upgrade module you used?

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

I test it and now all my orders is here.

I make upgrade from 1.4.9 directly to 1.5.6.2, and broke up, so i need to do a restoration.

I try to make in 2 step, from 1.4.9 to 1.4.11, and to 1.5.6.2, and it's ok. 

It's very rapid upgrade, both step is make in max 30 min.

But in the module is a big mess up.

After some bug like url settings and image settings, and 8 hour of searching on prestashop forum, all works well.

The new prestashop 1.5.6.2, is more configurable and have much more option and settings, but it's hard to upgrade from presta 1.4.

  • Like 1
Link to comment
Share on other sites

I have the same problem, with another store.

The problem is in upgrade checklist, all need to be green.

But i can't pass forward, because the mobil theme is blocking me.

I disable it, i delete it, but still get same error: 

You must disable the mobile theme disabled.gif

 

I disabled all my module, and i delete all themes except the default theme.

 

Any help please.

Link to comment
Share on other sites

Hi,

 

You need to unistall it. Not disabling it or delete it by ftp directly. The database and your /config/settings.inc.php must be clean.

 

If your settings.inc.php seems already clean (no if/else about "mobile" in it), you can yhen also look in ps_module table on phpmyadmin to delete the mobile_theme row.

DELETE FROM `ps_module`WHERE `name` LIKE 'mobile_theme' LIMIT 1

Regards

Link to comment
Share on other sites

I want to make this upgrade.

So, i do back with rollback, to 1.4.9.

I uninstall all non nativ module, and delete it.

I make upgrade with 1click upgrade, in 2 steps.

The problem is still here.

Error code on modules tab:

 

Fatal error: Cannot redeclare class AdminTabCore in /home/xxx/public_html/classes/AdminTab.php on line 31
[PrestaShop] Fatal error in module AdminTab:
Cannot redeclare class AdminTabCore

 

Here is my classes/AdminTab.php

/**
 * @deprecated 1.5.0
 */
abstract class AdminTabCore
{
	/** @var integer Tab id */
	public $id = -1;

	/** @var string Associated table name */
	public $table;

	/** @var string Object identifier inside the associated table */
	protected $identifier = false;

Link to comment
Share on other sites

  • 7 months later...

Hello,

 

I tried to make an upgrade from 1.2.4.0 to 1.5.3.1. I followed all the steps, but i got this error:

 

Fatal error: Class 'ObjectModel' not found in /homepages/7/d522019184/htdocs/demo/cinema2/classes/Configuration.php on line 28

 

And I tried everything you posted here but still not working.

 

Could you give me a hand on this?

 

Thanks!!

Link to comment
Share on other sites

×
×
  • Create New...