Skip to content

Error when creating a store view if there are CMS pages with the same URL key #28357

Closed
@stupachenko

Description

@stupachenko

Preconditions (*)

  1. Magento 2.4-develop

Steps to reproduce (*)

  1. Navigate to Admin Panel > Stores > All Stores and create 2 store views:
Name: German
Code: german
Status: Enabled
Name: French
Code: french
Status: Enabled
  1. Navigate to Admin Panel > Content > Pages and create 2 pages:
Page Title: About Us
URL Key: about-us
Store View: French
Page Title: About Us
URL Key: about-us
Store View: German
  1. Navigate to Admin Panel > Stores > All Stores and create store view
Name: Spanish
Code: spanish
Status: Enabled

Expected result (*)

  1. Store view created successfully.

Actual result (*)

  1. Error message "Something went wrong while saving. Please review the error log."
[2020-05-25 10:46:30] main.CRITICAL: Exception message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'about-us-4' for key 'URL_REWRITE_REQUEST_PATH_STORE_ID', query was: INSERT  INTO `url_rewrite` (`redirect_type`,`is_autogenerated`,`metadata`,`description`,`store_id`,`entity_type`,`entity_id`,`request_path`,`target_path`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?)
Trace: <pre>#1 Magento\Framework\DB\Adapter\Pdo\Mysql->query() called at [generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:128]
#2 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->query() called at [lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php:2105]
#3 Magento\Framework\DB\Adapter\Pdo\Mysql->insertArray() called at [generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:557]
#4 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->insertArray() called at [lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php:2062]
#5 Magento\Framework\DB\Adapter\Pdo\Mysql->insertMultiple() called at [generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php:544]
#6 Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->insertMultiple() called at [app/code/Magento/UrlRewrite/Model/Storage/DbStorage.php:337]
#7 Magento\UrlRewrite\Model\Storage\DbStorage->insertMultiple() called at [app/code/Magento/UrlRewrite/Model/Storage/DbStorage.php:287]
#8 Magento\UrlRewrite\Model\Storage\DbStorage->doReplace() called at [app/code/Magento/UrlRewrite/Model/Storage/AbstractStorage.php:87]
#9 Magento\UrlRewrite\Model\Storage\AbstractStorage->replace() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:58]
#10 Magento\UrlRewrite\Model\Storage\DbStorage\Interceptor->___callParent() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:138]
#11 Magento\UrlRewrite\Model\Storage\DbStorage\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#12 Magento\UrlRewrite\Model\Storage\DbStorage\Interceptor->___callPlugins() called at [generated/code/Magento/UrlRewrite/Model/Storage/DbStorage/Interceptor.php:65]
#13 Magento\UrlRewrite\Model\Storage\DbStorage\Interceptor->replace() called at [app/code/Magento/CmsUrlRewrite/Plugin/Cms/Model/Store/View.php:77]
#14 Magento\CmsUrlRewrite\Plugin\Cms\Model\Store\View->afterSave() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:146]
#15 Magento\Store\Model\ResourceModel\Store\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#16 Magento\Store\Model\ResourceModel\Store\Interceptor->___callPlugins() called at [generated/code/Magento/Store/Model/ResourceModel/Store/Interceptor.php:117]
#17 Magento\Store\Model\ResourceModel\Store\Interceptor->save() called at [lib/internal/Magento/Framework/Model/AbstractModel.php:654]
#18 Magento\Framework\Model\AbstractModel->save() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:58]
#19 Magento\Store\Model\Store\Interceptor->___callParent() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:138]
#20 Magento\Store\Model\Store\Interceptor->Magento\Framework\Interception\{closure}() called at [app/code/Magento/Theme/Model/Indexer/Design/Config/Plugin/Store.php:39]
#21 Magento\Theme\Model\Indexer\Design\Config\Plugin\Store->aroundSave() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:135]
#22 Magento\Store\Model\Store\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#23 Magento\Store\Model\Store\Interceptor->___callPlugins() called at [generated/code/Magento/Store/Model/Store/Interceptor.php:1040]
#24 Magento\Store\Model\Store\Interceptor->save() called at [app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php:72]
#25 Magento\Backend\Controller\Adminhtml\System\Store\Save->processStoreSave() called at [app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php:130]
#26 Magento\Backend\Controller\Adminhtml\System\Store\Save->execute() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:58]
#27 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->___callParent() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:138]
#28 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/App/Action/Plugin/ActionFlagNoDispatchPlugin.php:51]
#29 Magento\Framework\App\Action\Plugin\ActionFlagNoDispatchPlugin->aroundExecute() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:135]
#30 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#31 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Controller/Adminhtml/System/Store/Save/Interceptor.php:26]
#32 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->execute() called at [lib/internal/Magento/Framework/App/Action/Action.php:110]
#33 Magento\Framework\App\Action\Action->dispatch() called at [app/code/Magento/Backend/App/AbstractAction.php:150]
#34 Magento\Backend\App\AbstractAction->dispatch() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:58]
#35 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->___callParent() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:138]
#36 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [app/code/Magento/Backend/App/Action/Plugin/Authentication.php:143]
#37 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:135]
#38 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#39 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Controller/Adminhtml/System/Store/Save/Interceptor.php:39]
#40 Magento\Backend\Controller\Adminhtml\System\Store\Save\Interceptor->dispatch() called at [lib/internal/Magento/Framework/App/FrontController.php:186]
#41 Magento\Framework\App\FrontController->processRequest() called at [lib/internal/Magento/Framework/App/FrontController.php:118]
#42 Magento\Framework\App\FrontController->dispatch() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:58]
#43 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:138]
#44 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#45 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#46 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [lib/internal/Magento/Framework/App/Http.php:116]
#47 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#48 Magento\Framework\App\Http\Interceptor->launch() called at [lib/internal/Magento/Framework/App/Bootstrap.php:260]
#49 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:40]
</pre> [] []

Additional Information


  • Severity: S2

Metadata

Metadata

Labels

Component: StoreFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.Progress: doneReported on 2.4.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.Triage: DoneHas been reviewed and prioritized during Triage with Product Managers

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions