View Issue Details

IDProjectCategoryView StatusLast Update
0007362OXID eShop (all versions)2.4. Administer productspublic2022-11-22 10:13
Reporterkai.machemehl Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version6.5.0 
Fixed in Version6.5.1 
Summary0007362: Deleting Categories with more than one SEO Entry
DescriptionWhen trying to delete a Category with more than one SEO Entry, deletion is triggered but ends in an Maintenance Mode Error in Admin.
This error is thrown:

"SQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row"

This seems to happen in class vendor/oxid-esales/oxideshop-ce/source/Application/Model/SeoEncoderCategory.php method: setRelatedToCategorySeoUrlsAsExpired

Following this, the category is deleted but all SEO Entries are kept in Database.
Steps To Reproduce- Create category in admin backend
- For this category create at least for two languages a SEO entry in SEO tab.
- Try deleting the category
Additional InformationHad to put the log entry into the comments, since Mantis didn't allow it here.
Comment with the log: https://bugs.oxid-esales.com/view.php?id=7362#c14332
TagsAdmin, Category, Database, SEO
ThemeNot defined
BrowserNot defined
PHP Version8.1
Database VersionMariaDB 10.4

Activities

QA

2022-09-23 12:20

administrator   ~0014330

Hi kai.machemehl,

thank you for your report.

I tried but couldn't reproduce the case. I tracked the table "oxseo" during creating new SEOs for one category. Whenever I changed the SEO in the admin then the old entry got moved to the table oxseohistory (which can hold multiple records for an object) and got a new record in oxseo. The table oxseo holds only one record at a time for an object per language per shop id. When I deleted the category, the entry got removed from oxcategories, oxseo and oxseohistory. There were no rows with the oxid of the category left.

I got the impression that your oxseo tables holds multiple records for one object per language per shop id. Maybe some changes within the framework were made and cause this issue. Else I need further instructions how I can reproduce the case on a current shop version.

Best,
Michael

kai.machemehl

2022-09-23 12:23

reporter   ~0014331

That's an misunderstanding sorry. I created one SEO Entry for German, and one Seo Entry for english, and then tried deletion.

QA

2022-09-23 12:48

administrator   ~0014332

[2022-09-23 12:40:36] OXID Logger.ERROR: Subquery returns more than 1 row ["[object] (OxidEsales\\Eshop\\Core\\Exception\\DatabaseErrorException(code: 1242): Subquery returns more than 1 row at /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Database/Adapter/Doctrine/Database.php:955, Doctrine\\DBAL\\Exception\\DriverException(code: 0): An exception occurred while executing '\n select oxident\n from oxseo\n where oxseo.oxseourl like concat((select oxseourl from oxseo where oxobjectid = ? and oxtype = 'oxcategory'), '%') \n and (oxtype = 'oxcategory' or oxtype = 'oxarticle')\n ' with params [\"9ac3c2e3ad61629f98c4d1eca0231c94\"]:\n\nSQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row at /var/www/oxideshop/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:128, Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 21000): SQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row at /var/www/oxideshop/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18, PDOException(code: 21000): SQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row at /var/www/oxideshop/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117)\n[stacktrace]\n#0 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Database/Adapter/Doctrine/Database.php(615): OxidEsales\\EshopCommunity\\Core\\Database\\Adapter\\Doctrine\\Database->convertException(Object(Doctrine\\DBAL\\Exception\\DriverException))\n#1 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Application/Model/SeoEncoderCategory.php(278): OxidEsales\\EshopCommunity\\Core\\Database\\Adapter\\Doctrine\\Database->select('\\n se...', Array)\n#2 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Application/Model/SeoEncoderCategory.php(231): OxidEsales\\EshopCommunity\\Application\\Model\\SeoEncoderCategory->setRelatedToCategorySeoUrlsAsExpired(Object(OxidEsales\\Eshop\\Application\\Model\\Category))\n#3 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Application/Model/Category.php(333): OxidEsales\\EshopCommunity\\Application\\Model\\SeoEncoderCategory->onDeleteCategory(Object(OxidEsales\\Eshop\\Application\\Model\\Category))\n#4 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ee/Application/Model/Category.php(172): OxidEsales\\EshopCommunity\\Application\\Model\\Category->delete('9ac3c2e3ad61629...')\n#5 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Application/Controller/Admin/AdminListController.php(243): OxidEsales\\EshopEnterprise\\Application\\Model\\Category->delete('9ac3c2e3ad61629...')\n#6 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Controller/BaseController.php(534): OxidEsales\\EshopCommunity\\Application\\Controller\\Admin\\AdminListController->deleteEntry()\n#7 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ee/Core/Controller/BaseController.php(64): OxidEsales\\EshopCommunity\\Core\\Controller\\BaseController->executeFunction('deleteentry')\n#8 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(347): OxidEsales\\EshopEnterprise\\Core\\Controller\\BaseController->executeFunction('deleteentry')\n#9 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(280): OxidEsales\\EshopCommunity\\Core\\ShopControl->executeAction(Object(OxidEsales\\Eshop\\Application\\Controller\\Admin\\CategoryList), 'deleteentry')\n#10 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(142): OxidEsales\\EshopCommunity\\Core\\ShopControl->_process('OxidEsales\\\\Esho...', 'deleteentry', NULL, NULL)\n#11 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Oxid.php(27): OxidEsales\\EshopCommunity\\Core\\ShopControl->start()\n#12 /var/www/oxideshop/source/index.php(16): OxidEsales\\EshopCommunity\\Core\\Oxid::run()\n#13 /var/www/oxideshop/source/admin/index.php(12): require_once('/var/www/oxides...')\n#14 {main}\n"] []

QA

2022-09-23 12:49

administrator   ~0014333

- MK