Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create generic Symfony controller able to display a legacy page && handle its display via the Symfony controller automatically #32980

Closed
Tracked by #32875
fabienvallon opened this issue Jun 22, 2023 · 0 comments · Fixed by #34783
Assignees
Labels
9.0.x Branch CO Category: Core Symfony layout Task Type: neither a bug or a feature

Comments

@fabienvallon
Copy link

fabienvallon commented Jun 22, 2023

Description

The legacy pages are rendered thanks to the Dispatcher from the index.php For now, the idea is to reverse what the legacy layout was. We need a LegacyController::legacyPageAction that would be used as a wrapper around the legacy controllers. In this controller the layout is rendered by Symfony and only the content at the center would be rendered by the legacy controller wrapped. The first step is to have this controller usable via a forced URL with the legacy controller passed as a parameter.

Like the generical Symfony layout is based on a Twig component, this legacy display should also be handled via a Twig component that will look like the generic one a lot except for a few exceptions that we need to anticipate (non-exhaustive list):

  • the theme used should be the default one not the new-theme
  • the loaded assets should match with the ones originally set via AdminController::setMedia(false)
  • we need to handle correctly the backward compatibility, although it should already have been handled by Handle backward compatibility for smarty and context controller #33191
  • ... there may be some other things to consider / think about

Once the generic controller is done and the controller is available we can then remove the principle based on RouteNotFoundException in the index.php file, any URL even the legacy ones would be handled via Symfony

Some generic route mapping will need to be found to catch the legacy URLs, the URL should not change to avoid breaking changes, it's just that the layout would now be handled by Symfony. This will simplify the work about authentication by Symfony a lot since after this ALL the pages (including the legacy ones) would be handled by the framework.

Example:

legacy_controller_route:
  path: /controller={controllerName}
  defaults:
    _controller: LegacyLayoutController::legacyPageAction

Acceptance test

  1. This controller should be able to display a legacy page ( TBD )
    Could be test manually by forcing the URL

  2. Handle legacy page display via the Symfony controller automatically and systematically

  3. UI tests work fine with Symfony layout enabled, and on legacy pages

  4. Test multistore shop list

  5. Test the productcomment in the BO. It should work as ISO

@fabienvallon fabienvallon changed the title The legacy pages are rendered thanks to the Dispatcher from the index.php For now, the idea is to reverse what the legacy layout was. We need a LegacyController::legacyPageAction that would be used as a wrapper around the legacy controllers. In this controller the layout is rendered by Symfony and only the content at the center would be rendered by the legacy controller wrapped. The first step is to have this controller usable via a forced URL with the legacy controller passed as a parameter. Replacing layout in legacy pages ( part 1) Jun 22, 2023
@jolelievre jolelievre changed the title Replacing layout in legacy pages ( part 1) Replacing layout in legacy pages ( part 1) - Create generic Symfony controller able to display a legacy page Jun 22, 2023
@jolelievre jolelievre changed the title Replacing layout in legacy pages ( part 1) - Create generic Symfony controller able to display a legacy page Create generic Symfony controller able to display a legacy page Jun 22, 2023
@fabienvallon fabienvallon changed the title Create generic Symfony controller able to display a legacy page [Replacing Legacy Layout] Create generic Symfony controller able to display a legacy page Jul 7, 2023
@fabienvallon fabienvallon changed the title [Replacing Legacy Layout] Create generic Symfony controller able to display a legacy page [Replacing layout in legacy pages] Create generic Symfony controller able to display a legacy page Jul 7, 2023
@jolelievre jolelievre changed the title [Replacing layout in legacy pages] Create generic Symfony controller able to display a legacy page Create generic Symfony controller able to display a legacy page Jul 10, 2023
@jolelievre jolelievre added Task Type: neither a bug or a feature New New issue not yet processed by QA 9.0.x Branch labels Jul 10, 2023
@hibatallahAouadni hibatallahAouadni added CO Category: Core Needs Specs Status: issue needs to be specified and removed New New issue not yet processed by QA labels Jul 11, 2023
@MatShir MatShir changed the title Create generic Symfony controller able to display a legacy page Create generic Symfony controller able to display a legacy page and Handle legacy page display via the Symfony controller automatically and systematically Jan 12, 2024
@MatShir MatShir changed the title Create generic Symfony controller able to display a legacy page and Handle legacy page display via the Symfony controller automatically and systematically Create generic Symfony controller able to display a legacy page and its display via the Symfony controller automatically Jan 12, 2024
@MatShir MatShir changed the title Create generic Symfony controller able to display a legacy page and its display via the Symfony controller automatically Create generic Symfony controller able to display a legacy page && its display via the Symfony controller automatically Jan 12, 2024
@MatShir MatShir changed the title Create generic Symfony controller able to display a legacy page && its display via the Symfony controller automatically Create generic Symfony controller able to display a legacy page && handle its display via the Symfony controller automatically Jan 12, 2024
@prestashop-issue-bot prestashop-issue-bot bot removed the Needs Specs Status: issue needs to be specified label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9.0.x Branch CO Category: Core Symfony layout Task Type: neither a bug or a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants