contao / core-bundle

[READ-ONLY] Contao Core Bundle
GNU Lesser General Public License v3.0
123 stars 58 forks source link

Back link broken due to "referer" issue in session when DCAs have 3+ levels of ptable/ctables #1719

Closed rhymeadam closed 3 years ago

rhymeadam commented 3 years ago

Hi all, I am able to reproduce this in the Contao Demo as well. Here are the steps:

Create a new theme so there are 2 to choose from.

Screen Shot 2021-02-10 at 4 09 37 AM Screen Shot 2021-02-10 at 4 10 05 AM

Create a new stylesheet in the Contao Demo theme.

Screen Shot 2021-02-10 at 4 10 19 AM Screen Shot 2021-02-10 at 4 10 40 AM

Create a style in that stylesheet.

Screen Shot 2021-02-10 at 4 10 51 AM Screen Shot 2021-02-10 at 4 11 18 AM

Click the "Themes" link in the left column navigation (id="tl_navigation"), then go to the new theme and create a stylesheet.

Screen Shot 2021-02-10 at 4 12 38 AM Screen Shot 2021-02-10 at 4 11 37 AM Screen Shot 2021-02-10 at 4 11 49 AM Screen Shot 2021-02-10 at 4 12 04 AM

Create a new style in that stylesheet.

Screen Shot 2021-02-10 at 4 12 15 AM Screen Shot 2021-02-10 at 4 12 30 AM

Click the "Themes" link in the left column navigation (id="tl_navigation") again.

Screen Shot 2021-02-10 at 4 12 38 AM

Click the CSS icon for the new theme.

Screen Shot 2021-02-10 at 4 12 50 AM

Edit the new theme's stylesheet.

Screen Shot 2021-02-10 at 4 13 01 AM

Click the back button.

Screen Shot 2021-02-10 at 4 13 09 AM

Instead of going back to the new theme's stylesheet parentView, it goes to the original Contao Demo theme's parentView.

Screen Shot 2021-02-10 at 4 13 16 AM

I believe swapping the arrays in the "array_merge" on the following line fixes this, but I haven't tested it out fully yet. I understand that the stylesheets in Contao are going to be removed, but other extensions and customizations that we have built depend on this functionality to work properly. Please let me know if this can be fixed sometime soon. Thanks!

https://github.com/contao/core-bundle/blob/7c86adf2e04faae96bd303989a64543d60b22b7b/src/EventListener/StoreRefererListener.php#L85

github-actions[bot] commented 3 years ago

Thank you for your contribution.

Unfortunately, you have created your issue in the wrong repository, as this is a read-only split repository. Please go to https://github.com/contao/contao and create your issue there.