[PAGES-481] Uses BaseApp class instead of PagesContentApp: One can not differentiate between "New Page" and "Change Template" anymore -> big problem for TemplatesAvailability Created: 22/Jul/21  Updated: 05/Feb/24

Status: Open
Project: Magnolia pages module
Component/s: Pages app
Affects Version/s: 6.2, 6.2.1, 6.2.2, 6.2.3, 6.2.4, 6.2.5, 6.2.6, 6.2.7, 6.2.8, 6.2.9
Fix Version/s: 6.3.0

Type: Bug Priority: Major
Reporter: Christian Ringele Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Java Source File HierarchicalConfiguredSiteTemplateAvailability.java    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Epic Link: AuthorX Maintenance
Team: AuthorX

 Description   

Base Problem:

Our OTB Site’s templateAvailability is not applicable in a real project, as its not reacting to any hierarchy AND its is not YAML based: For example a 'home-template' can be added anywhere.

Therefore a real project has to implement its own custom Site’s templateAvailability. As I had to do for the author training (and also fullstack-training):
For teaching proper multisite behavior => capability to manage properly where what page-template can be added (home templates only at top etc)

See the attached custom implementation 'HierarchicalConfiguredSiteTemplateAvailability'.

Specific problem

In the new UI framework, one can not differentiate between the Action/Situation of:

  1. "Add Page" => a new temp Page-Node is created before persistance
  2. "Change Template" => an existing page changes the template

In both cases the system checks the Site’s templateAvailability.

In the old UI framework, the pages App used the class info.magnolia.pages.app.PagesContentApp
Where the “PagesContentApp” class passed the tempNode (line 121) , the NEW node to create.

Now the pages app uses the default class info.magnolia.ui.framework.app.BaseApp. Which does: On “Add Page” it passes the existing parent node of the new node! => this is bad!

Reproduce

Use the default OTB Site’s templateAvailability and one can see the call

For reproduction in real multisite environment, use the attached Java class 'HierarchicalConfiguredSiteTemplateAvailability' and create this configuration:
https://wiki.magnolia-cms.com/display/FullStackTraining62/%5BExercise%5D+Use+Custom+YAML+based+TemplatesAvailability

 


Generated at Mon Feb 12 06:19:22 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.