[MGNLSTK-825] stkSection should have a subcategory too! Created: 16/Jan/12  Updated: 25/Jan/12  Resolved: 24/Jan/12

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

Type: Bug Priority: Neutral
Reporter: Will Scheidegger Assignee: Unassigned
Resolution: Not an issue Votes: 0
Labels: None
Remaining Estimate: 0.25h
Time Spent: Not Specified
Original Estimate: 0.25h

Attachments: Text File stkSection.patch    
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Date of First Response:

 Description   

All STK template definitions should have a subcategory - even if it's the same value as the category. This will assure that TemplateCategoryUtil.getTemplateSubCategory(currContent) always returns a value and not null.

Since all other STK template definitions do have a subcategory I assume this has just been forgotten in stkSection.



 Comments   
Comment by Ondrej Chytil [ 24/Jan/12 ]

Subcategory is not a mandatory property in template definition, mainly specifies content and feature categories.
Anyway you can add it to your definition to avoid handling possible null value on return.

Comment by Will Scheidegger [ 24/Jan/12 ]

I know that I can add it - and I did (see the patch). And I'm also aware that it's not mandatory. It's just that if you add a section page underneath a shopRoot page (the shop Magnolia officially supports) and then a product category or product details page underneath, you will get an NPE.

I knew how to fix it, but don't think that the average Joe will solve the problem that quickly. So it would be a very small adaption to a bootstrap file which does not hurt anyone but makes life easier for the Magnolia users (one less exception to worry about). Therefore I would not consider this "Not an issue".

Back under my rock I go!
-will

Comment by Ondrej Chytil [ 25/Jan/12 ]

Point of my comment is that this is not STK issue (or Magnolia as such). It might cause some troubles in custom projects, question is if it's worth of making some property mandatory because of that.
Moreover shop module issue was not mentioned in description, just that one method can throw NPE. In that context I agree it's an issue. But one that belongs under shop module and there it should be solved by either checking for this null value or adding install task to create subcategory property (I don't have details about the issue so maybe adding property is really requisite).

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