Open aliomattux opened 2 years ago
Hi @aliomattux. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Hi @engcom-Hotel. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
@magento give me 2.4-develop instance
Hi @engcom-Hotel. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Hotel, here is your Magento Instance: https://2c8a342c3915f819f9d770eb549093b3.instances.magento-community.engineering Admin access: https://2c8a342c3915f819f9d770eb549093b3.instances.magento-community.engineering/admin_ec37 Login: b9a88714 Password: d20993e15b96
Hello @aliomattux,
Thanks for posting the issue!
We have tried to reproduce the issue in the fresh installed Magento 2.4-develop branch. But for us, the issue is not reproducible. We are able to save the CMS block successfully. Please have a look at the below screenshot for reference:
Let us know if we have missed anything.
Thanks
In my case I have to problem when I create a CMS page with URL key "newsletter". If I change the URL key to newsletter1 it works fine.
@engcom-Hotel, I am having the issue with a CMS Page, with any duplicate URL for two different store's CMS Pages. This should not happen.
Preconditions 2.3.7p-2, MultiStore enabled
Steps to reproduce Go to Content > Pages Create two CMS pages with different store views, and identical URL identifiers (e.g. "home") Press Save
Expected result The CMS page is saved without error.
Actual result Error message is thrown preventing saving. "Could not save the page: URL key for specified store already exists."
Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Verified the issue on Magento 2.4-develop branch and the issue is reproducible: Admin - Content - Pages - Add New page or Edit existing page with URL key: shipping and Save
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-2554 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
@magento I am working on this
Hello @aliomattux i've try to reproduce issue in magento 2.4.3-p1. If you have cms page with url key like "shipping, cart, checkout" you will not be able to save it after migration because the validator of url key will find that there is frontend route "shipping, cart, checkout" defined from modules. if you want to remove this validator then remove line from
diff --git a/vendor/magento/module-cms/Model/PageRepository.php b/vendor/magento/module-cms/Model/PageRepository.php index e0f50bd..8881534 100644 --- a/vendor/magento/module-cms/Model/PageRepository.php +++ b/vendor/magento/module-cms/Model/PageRepository.php @@ -168,7 +168,7 @@ class PageRepository implements PageRepositoryInterface
}
try {
$this->validateLayoutUpdate($page);
//$this->validateRoutesDuplication($page);
$this->resource->save($page);
$this->identityMap->add($page);
} catch (\Exception $exception) {
please check this and let me know if any issues. Thanks
@pranav7870 Will this fix also fix the problem for ANY url key, not just "shipping, cart, checkout"? @engcom-November verified this as a bug further upthread. This happens when any CMS Page's url key matches another. (e.g "home", "distributors", "XYZ", etc.
@pranav7870 Will this fix also fix the problem for ANY url key, not just "shipping, cart, checkout"? @engcom-November verified this as a bug further upthread. This happens when any CMS Page's url key matches another. (e.g "home", "distributors", "XYZ", etc.
Hello @chardwick99 i've fix this for all urls please check with my code, please check and let me know. Thanks
@pranav7870 I already know about the proposed "fix". This fix requires me to modify the core code. I reported this as a bug because of the industry standard use of the url key "shipping". As stated in my initial post, many popular ecommerce websites use the url. Additionally, Magento 2 has been operational for years and many ecommerce stores already make use of the url key shipping. Creating the requirement for customers to change the url IMO is a bug introduced. I do not expect it to be changed, but it should be. Therefore, I reject the proposal customers should have to modify their installation to bypass the issue.
I have the same issue with route "klarna". After longer consideration that mechanism is not entirely bad, but should more accurate, for example these routes reserved by modules, are not fully occupied, for example 'klarna/index/index' is up for grabs.
If certain page identifiers should be "reserved", their error message should be adapted and not direct in a direction of page identifier duplicates – which is also correct in some way but it won't help you finding the duplicate in your cms pages.
Getting the same issue but with url_key contact
. Magento version 2.4.5-p2.
There are no other CMS pages with the same url key, nor are there any redirects setup for that particular key. The option Add Store Code to Urls
is configured to "No". This used to work in the previous version (Magento 2.3.5-p2).
This error is not due to specicif key reserved.
To reproduce the bug you can do :
ex : you create a /faq page with all store
=> Magento generate all url_rewrite with all store
you want to create a page for /faq for a specific store
=> You have this error : "The value specified in the URL Key field would generate a URL that already exists."
Here is the patch to fix the bug :
--- Observer/ProcessUrlRewriteSavingObserver.php
+++ Observer/ProcessUrlRewriteSavingObserver.php
@@ -46,9 +46,15 @@
if ($cmsPage->dataHasChangedFor('identifier')
|| $cmsPage->dataHasChangedFor('store_id')
- || $cmsPage->getData('rewrites_update_force')
) {
$urls = $this->cmsPageUrlRewriteGenerator->generate($cmsPage);
+
+ if ($cmsPage->getStoreId()) {
+ $this->urlPersist->deleteByData([
+ UrlRewrite::REQUEST_PATH => $cmsPage->getIdentifier(),
+ UrlRewrite::STORE_ID => $cmsPage->getStoreId(),
+ ]);
+ }
$this->urlPersist->deleteByData([
UrlRewrite::ENTITY_ID => $cmsPage->getId(),
Hi @aliomattux ,
Thanks for your reporting and collaboration. We have re-verified the issue in latest 2.4-develop instance and the issue is reproducible. Kindly refer the screenshots. Steps to reproduce
Thanks.
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
Description This bug report is linked to bug: https://github.com/magento/magento2/issues/31007 but is not the same issue.
It is easy to respond and say that Magento core has a frontName value of shipping and therefore, you cannot use ever the url key shipping.
In a rebuttal to such a general statement, shipping is one of the most popular and widely used urls. It is a url used by companies to explain shipping polciies. Several major websites worldwide use this url, and Magento is saying, you cannot use it.
This new validator did not exist in previous versions of Magento 2. In our case we have had since 2008 a url for /shipping. Now Magento decides to not allow it, that doesn't work. We are forced to override "woraround" the validator to update content to a page that cannot just be changed because Magento needs it.