Details
-
Bug
-
Resolution: Unresolved
-
High
-
2.5.6
-
None
Description
Clicking the "Edit" button on Landing Page will open this page for edition in PageBuilder. Pagebuilder then checks if there is the last used SiteAccess stored in the session. If so, SiteAccess is then forced to be used in PageBuilder.
Steps to reproduce:
Steps to reproduce
1. Clean installation of eZ Platform 2.5.6
2. Log in to the Backoffice as admin. In Content tree root (Home) create and publish Folder Folder A.
3. In Content tree root (Home) create and publish Folder Folder B.
4. In Folder A create Landing Page Test Page and publish it.
5. Set up your project as follows (ezplatform.yml):
siteaccess: list: [site_a, site_b, admin] groups: site_group: [site_a, site_b] admin_group: [admin] default_siteaccess: site_a match: URIElement: 1
system: admin_group: languages: [eng-GB] page_builder: siteaccess_list: [site_a, site_b, site] content_tree_module: contextual_tree_root_location_ids: - 2 # Home (Content structure) - 5 # Users - 43 # Media - 48 # Setup - 55 # Forms subtree_paths: content: /1/2/ media: /1/43/ site_a: languages: [eng-GB] content_view: full: landing_page: template: 'full/landing_page_a.html.twig' match: Identifier\ContentType: ["landing_page"] content: tree_root: location_id: 56 excluded_uri_prefixes: [ /media, /images ] site_b: languages: [eng-GB] content_view: full: landing_page: template: 'full/landing_page_b.html.twig' match: Identifier\ContentType: ["landing_page"] content: tree_root: location_id: 57 excluded_uri_prefixes: [ /media, /images ]
6. Create a new template app/Resources/views/full/landing_page_a.html.twig:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> {% if content is defined %} {% set title = ez_content_name(content) %} {% endif %} <title>{{ title|default('Hello World!'|trans) }}</title> </head> <body style="padding-top: 50px; background: #6da2f7"> <div class="container" style="background: #fff"> <h1>Site A</h1> {% block content %} <h1>{{ ez_content_name(content) }}</h1> {{ ez_render_field(content, 'page') }} {% endblock %} </div> </body> </html>
7. Create a new template app/Resources/views/full/landing_page_b.html.twig:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> {% if content is defined %} {% set title = ez_content_name(content) %} {% endif %} <title>{{ title|default('Hello World!'|trans) }}</title> </head> <body style="padding-top: 50px; background: #f76de9"> <div class="container" style="background: #fff"> <h1>Site B</h1> {% block content %} <h1>{{ ez_content_name(content) }}</h1> {{ ez_render_field(content, 'page') }} {% endblock %} </div> </body> </html>
8. Go to the Backoffice > Folder A > Test Page.
9. Clik on "Page" tab, choose "site_b". Folder B will be opened (site_b content tree root) instead Test Page, as site_b SiteAccess has different content tree root than Test Page - this is expected behaviour.
10. Click "back" in browser, in Test Page view click on "Edit" button in right menu.
Result
Test Page will be opened in site_b SiteAccess for edition.
Expected Result
Test Page will be opened in SiteAccess with tree root that contains Test Page (site/site_a).