[MGNLSTK-1476] Reordering pages uses wrong path for template availibility check. Created: 27/Nov/14  Updated: 15/Apr/16  Resolved: 20/Jul/15

Status: Closed
Project: Magnolia Standard Templating Kit (closed)
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Rico Jansen Assignee: Trang Truong
Resolution: Obsolete Votes: 0
Labels: quickwin, support, vpro
Remaining Estimate: 0d
Time Spent: 5d
Original Estimate: 1d

Issue Links:
supersession
is superseded by MAGNOLIA-6305 Reordering pages uses wrong path for ... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:
Sprint: Sprint 1 (Vietnam), Sprint 2 (Basel)
Story Points: 1

 Description   

When reordering pages in admincentral the info.magnolia.module.templatingkit.sites.TemplateAvailability#isAvailable check is done with a temporaryNode that has as parent the node that the node to be moved is moved below.
So for example I have a set of nodes under a NewsOverview when I move node 'News01' below node 'News02' the path for the check is 'News02/temporaryNode'.

This is incorrect, it should use the parent (the overview) node of node News01 as that is the parent that the node will have after the move, it will not be a child of News02.

Because our templateavailability disallows news pages as parent of news pages this does not work.



 Comments   
Comment by Richard Gange [ 05/Mar/15 ]

Hi Rico-

I think I have to disagree with you here. If News01 is being moved under News02 then we need to look at what the template availability is at the level under News02. In that case we are talking about a content page under a content page which is a legal move in info.magnolia.module.templatingkit.sites.TemplateAvailability.

if (category.equals(TemplateCategory.CONTENT)) {
    return parentTemplateCategory.equals(TemplateCategory.SECTION) || 
           parentTemplateCategory.equals(TemplateCategory.CONTENT) || 
           parentTemplateCategory.equals(TemplateCategory.FEATURE) || 
           parentTemplateCategory.equals(TemplateCategory.FUNCTIONAL);
}

This is incorrect, it should use the parent (the overview) node of node News01 as that is the parent that the node will have after the move, it will not be a child of News02.

Our template availability class would not restrict that move so News02 would be the parent after the move.

If you want to implement your own template availability class to restrict that move then I would suggest adding a logic to restrict on subcategory as well. In this case news pages have a subcategory of news.

Hope that helps
Rich

Comment by Rico Jansen [ 06/Mar/15 ]

I think you misunderstood me, I'll try to clear it up.
When you reorder a list of pages below a NewsOverview eg.

  • News01
  • News03
  • News02

And you want to move
News02 to the position below News01 to get the list:

  • News01
  • News02
  • News03

The check done with the availibility is:
News01/temporaryNode

And it should be:
NewsOverview

Comment by Richard Gange [ 06/Mar/15 ]

Thanks for that clarification. I do see the issue now.

Regards
Rich

Comment by Trang Truong [ 06/May/15 ]

@Richard
Please could you provide me the affected version. I tested it with STK version 2.8.9 and it works as expected.
Thanks in advance.

Comment by Nils Breunese [ 26/May/15 ]

The original support issue was filed against Magnolia 4.5.24 with STK 2.0.22.

Comment by Trang Truong [ 02/Jun/15 ]

This putted to lower priority in release 4.5.x and the reason for interrupted progress is I couldn't reproduce it at the time with STK 2.8.9. However, the affected version is provided 2.0.x now.

Generated at Mon Feb 12 07:36:56 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.