Hallo liebe Community,
bei der Migration eines PrestaShop (1.6.0.9) wird mir nachfolgende Fehlermeldung angezeigt, die ich leider nicht deuten kann. Ich bitte um eure Hilfe bzw. Meinung dazu.
Ich nutze das Migrationstool in der neusten Version (2.4.0) unter Shopware 5.1.2.
p.s: Die gleiche Fehlermeldung wurde mir im ersten Test-Szenarion (Migartionstool 2.3.1 unter Shopware 5.0.4) angezeigt.
Beim Importieren der Preise ist ein Fehler aufgetreten
Code : 23000
Line : 234
File : /var/www/vhosts/domain.tld/httpdocs/engine/Library/Zend/Db/Statement/Pdo.php
Error : SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id_product' in order clause is ambiguous
Trace : #0 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Zend/Db/Statement.php(303): Zend_Db_Statement_Pdo->_execute(Array) #1 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array) #2 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('(??????SELECT? ...', Array) #3 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php(75): Zend_Db_Adapter_Pdo_Abstract->query('(??????SELECT? ...', Array) #4 [internal function]: Enlight_Components_Db_Adapter_Pdo_Mysql->query('(??????SELECT? ...') #5 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Plugins/Community/Backend/SwagMigration/Components/Migration/DbDecorator.php(128): call_user_func_array(Array, Array) #6 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Plugins/Community/Backend/SwagMigration/Components/Migration/Profile.php(567): Shopware_Components_Migration_DbDecorator->__call('query', Array) #7 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Plugins/Community/Backend/SwagMigration/Components/Migration/Profile.php(567): Shopware_Components_Migration_DbDecorator->query('(??????SELECT? ...') #8 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Plugins/Community/Backend/SwagMigration/Components/Migration/Import/Resource/Price.php(108): Shopware_Components_Migration_Profile->queryProductPrices(0) #9 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Plugins/Community/Backend/SwagMigration/Controllers/Backend/SwagMigration.php(474): Shopware_Components_Migration_Import_Resource_Price->run() #10 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Plugins/Community/Backend/SwagMigration/Controllers/Backend/SwagMigration.php(511): Shopware_Controllers_Backend_SwagMigration->runImport('import_prices') #11 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Enlight/Controller/Action.php(158): Shopware_Controllers_Backend_SwagMigration->importAction() #12 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Enlight/Controller/Dispatcher/Default.php(523): Enlight_Controller_Action->dispatch('importAction') #13 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Enlight/Controller/Front.php(226): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp)) #14 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Kernel.php(153): Enlight_Controller_Front->dispatch() #15 /var/www/vhosts/domain.tld/httpdocs/vendor/symfony/http-kernel/HttpCache/HttpCache.php(492): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Components/HttpCache/AppCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #17 /var/www/vhosts/domain.tld/httpdocs/vendor/symfony/http-kernel/HttpCache/HttpCache.php(263): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true) #18 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Components/HttpCache/AppCache.php(103): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true) #19 /var/www/vhosts/domain.tld/httpdocs/shopware.php(101): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request)) #20 {main}
OK
Hi,
wenn du in der folgenden Zeile das “id_product” durch “pr.id_product” ersetzt, geht es vielleicht schon:
/**
* Returns the sql statement to select the shop system article image allocation
*
* @return string {String} | sql for the article image allocation
*/
public function getProductImageSelect()
{
// prestashop generates the image path from the "id_image" ID by splitting it after
// each char and concatening it with slashes. This behaviour is somewhat hard
// to reproduce with sql
// perhaps this should rather be done via php
$replaceSql = "
CONCAT(
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
REPLACE(REPLACE(REPLACE(REPLACE(
id_image,
0, '0/'), 1, '1/') , 2, '2/') , 3, '3/') , 4, '4/'), 5, '5/'),
6, '6/'), 7, '7/'), 8, '8/'), 9, '9/'),
id_image,
'.jpg'
) as image";
Besten Gruß,
Daniel
„id_product“ durch „pr.id_product“ ersetzen
Leider ist dies nicht die Lösung. Mit dieser Änderung erhalte ich nun folgende Meldung.
db_cust_1 = Shopware
db_cust_2 = Presta Shop
An error occurred while generating configuratos
Code : 42
Line : 234
File : /var/www/vhosts/domain.tld/httpdocs/engine/Library/Zend/Db/Statement/Pdo.php
Error : SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_cust_2.ps_product' doesn't exist
Trace : #0 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Zend/Db/Statement.php(303): Zend_Db_Statement_Pdo->_execute(Array) #1 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array) #2 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('? SE...', Array) #3 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php(75): Zend_Db_Adapter_Pdo_Abstract->query('? SE...', Array) #4 [internal function]: Enlight_Components_Db_Adapter_Pdo_Mysql->query('? SE...') #5 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Plugins/Community/Backend/SwagMigration/Components/Migration/DbDecorator.php(128): call_user_func_array(Array, Array) #6 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Plugins/Community/Backend/SwagMigration/Components/Migration/Profile.php(448): Shopware_Components_Migration_DbDecorator->__call('query', Array) #7 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Plugins/Community/Backend/SwagMigration/Components/Migration/Profile.php(448): Shopware_Components_Migration_DbDecorator->query('? SE...') #8 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Plugins/Community/Backend/SwagMigration/Components/Migration/Import/Resource/Configurator.php(100): Shopware_Components_Migration_Profile->queryAttributedProducts(0) #9 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Plugins/Community/Backend/SwagMigration/Controllers/Backend/SwagMigration.php(474): Shopware_Components_Migration_Import_Resource_Configurator->run() #10 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Plugins/Community/Backend/SwagMigration/Controllers/Backend/SwagMigration.php(511): Shopware_Controllers_Backend_SwagMigration->runImport('import_generate...') #11 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Enlight/Controller/Action.php(158): Shopware_Controllers_Backend_SwagMigration->importAction() #12 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Enlight/Controller/Dispatcher/Default.php(523): Enlight_Controller_Action->dispatch('importAction') #13 /var/www/vhosts/domain.tld/httpdocs/engine/Library/Enlight/Controller/Front.php(226): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp)) #14 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Kernel.php(153): Enlight_Controller_Front->dispatch() #15 /var/www/vhosts/domain.tld/httpdocs/vendor/symfony/http-kernel/HttpCache/HttpCache.php(492): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Components/HttpCache/AppCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #17 /var/www/vhosts/domain.tld/httpdocs/vendor/symfony/http-kernel/HttpCache/HttpCache.php(263): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true) #18 /var/www/vhosts/domain.tld/httpdocs/engine/Shopware/Components/HttpCache/AppCache.php(103): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true) #19 /var/www/vhosts/domain.tld/httpdocs/shopware.php(101): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request)) #20 {main}
OK
Hi,
gibt es die Tabelle „ps_product“ denn wirklich nicht? Hat die vielleicht ein anderes Präfix? So wie ich das im Code sehe, kann das Migrationstool an einigen Stellen keine abweichenden Präfixes als „ps_“. Das könnte also vll. schon daran liegen, das könnte man dann noch relativ fix anpassen.
Daniel
Cagoo
15. Oktober 2016 um 08:26
5
Hi,
gibt es die Tabelle „ps_product“ denn wirklich nicht? Hat die vielleicht ein anderes Präfix? So wie ich das im Code sehe, kann das Migrationstool an einigen Stellen keine abweichenden Präfixes als „ps_“. Das könnte also vll. schon daran liegen, das könnte man dann noch relativ fix anpassen.
Hallo, ich habe exakt das gleiche Problem… und die Tabelle „ps_product“ gibt es bei der zu importierenden datenbank… Hat jemand eine abschließende Lösung?
Danke und Grüße, Thomas
swat
15. Oktober 2016 um 09:40
6
So ähnlich wie Daniel sagte, scheint man das Problem in den Griff zu kriegen. In Zeile 294 jedoch muss “id_product” durch “pr.id_product” ersetzt werden: http://blog.php-function.de/prestashop-shopware-column-id_product-in-order-clause-is-ambiguous/