magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Content Page grid view url doesn't work for some pages #37869

Closed MrBlueEyez closed 1 year ago

MrBlueEyez commented 1 year ago

Preconditions and environment

Steps to reproduce

  1. Open the admin panel and login
  2. Go towards Content > Elements > Pages
  3. Make sure some pages are existing, and try to use the "View" action of some.

Expected result

Every view action should work, and we should end up on the page we wanted to view. As of 2.4.6 the url encode is working with RFC3986, and is decoding = to ~ instead of a comma. We expect all urls to now work with tildes.

Actual result

The view url is generated using the Magento\Framework\Url\QueryParamsResolver which is using the default php function http_build_query to convert the url . However the uenc which is included is using the new encoder, and so can have tildes in it. The http_build_query is using the PHP_QUERY_RFC1738 instead of the PHP_QUERY_RFC3986 which causes the tildes to be converted towards %7E.

This all ends up with the admin getting redirect towards the home page, and not the page that was requested.

Additional information

It might be hard to reproduce this, as I am not 100% sure when the unencoded uenc contains =.

Release note

Using RFC3986 in the http_build_query, to be in line with https://github.com/magento/magento2/pull/35885

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @MrBlueEyez. Thank you for your report. To speed up processing of this issue, 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:

m2-assistant[bot] commented 1 year ago

Hi @engcom-Bravo. 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:

engcom-Bravo commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo, here is your Magento Instance: https://55d1cece3065473da76e4c11c178cada.instances-prod.magento-community.engineering Admin access: https://55d1cece3065473da76e4c11c178cada.instances-prod.magento-community.engineering/admin_7983 Login: 830bc424 Password: faa9c4df3462

engcom-Bravo commented 1 year ago

Hi @MrBlueEyez,

Thank you for reporting and collaboration.

Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.

Steps to reproduce

Screenshot 2023-08-10 at 2 14 46 PM Screenshot 2023-08-10 at 2 14 51 PM Screenshot 2023-08-10 at 2 14 54 PM

Every view action is working we are getting the page wanted to view and ~ converting instead of a comma.please let us if we are missing anything.

Thanks.

engcom-Bravo commented 1 year ago

Hi @MrBlueEyez,

Kindly provide latest update on this comment https://github.com/magento/magento2/issues/37869#issuecomment-1673093202 still you are working on this issue if you are able to reproduce the issue please elaborate the steps to reproduce.Please let us know still if you are facing any issue.

Thanks.

MrBlueEyez commented 1 year ago

Hello, The issue is still reproducable, it is beter to check the decoded uenc inside the preview url itself. Instead of checking the final page you end up. In the provided example provided by @engcom-Bravo I do not see any "~" inside the url, hence the situation is not reproduced.

Please try again with another page with larger names (I do not know what triggers the "=" inside base64 decoded string, but you will have to reproduce that)

engcom-Bravo commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo, here is your Magento Instance: https://55d1cece3065473da76e4c11c178cada.instances-prod.magento-community.engineering Admin access: https://55d1cece3065473da76e4c11c178cada.instances-prod.magento-community.engineering/admin_e5fa Login: 8122b51d Password: e3fc7eb3ca0d

engcom-Bravo commented 1 year ago

Hi @MrBlueEyez,

Thanks for your update.

We have given ~ for content pages and it is converting into - in SEO.

Screenshot 2023-08-31 at 3 00 01 PM Screenshot 2023-08-31 at 3 02 18 PM

While giving ~ in SEO section we are getting below error.

Screenshot 2023-08-31 at 3 07 58 PM

Could you please elaborate the steps to reproduce and also provide screenshots and video if possible it will helps us to reproduce the issue easily.

Thanks.

MrBlueEyez commented 1 year ago

Hello @engcom-Bravo ,

it is not about having those characters in the page title. For some pages, which a normal title, the url that is generated and then encoded for the switch/redirect action, is getting a ~.

Try having a url for the page which does not have a multitude of 4 characters. As base64 encoding adds extra = characters to make sure it has a multitude of 4 characters. (EG: example.test/heyy has 17 characters, which is 1 more then any amount of 4 characters). Also keep in mind that https:// will also be added and will also help in this count. So best thing is to just try changing the url_key with + 1 letter untill you get an encoded url with == in it, which should then be changed to ~.

engcom-Bravo commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo, here is your Magento Instance: https://55d1cece3065473da76e4c11c178cada.instances-prod.magento-community.engineering Admin access: https://55d1cece3065473da76e4c11c178cada.instances-prod.magento-community.engineering/admin_2642 Login: 1bfda593 Password: ed01a59c97da

engcom-Bravo commented 1 year ago

Hi @MrBlueEyez,

Thanks for your update.

We have used this String magentothusdw which contains Encoded value as bWFnZW50b3RodXNkdw==.The same value we have given in Url key for pages.

Screenshot 2023-09-05 at 1 33 19 PM Screenshot 2023-09-05 at 1 34 10 PM

The view action is working fine and we are able to access the page.Could you please let us know if we are missing anything.Please provide screenshots it will helps us to proceed further.

Thanks.

engcom-Bravo commented 1 year ago

Hi @MrBlueEyez,

We have noticed that this issue has not been updated since long time.
Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks.