[DOCU-1500] Included snippets can cause validation issues Created: 07/May/18  Updated: 11/May/18  Resolved: 11/May/18

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: 5.5.6
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Julie Legendre Assignee: Richard Gange
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality

 Description   

Info from SUPPORT-8631:

If you have any snippet file containing action definitions inside your module, concretely in the apps folder, it may be processed as if it were an app definition and return an error. When upgrading to 5.5.6, we recommend you check your module structure to ensure it does not contain fragments in app folders in modules that are used with the !include directive.

As of version 5.5.6 Magnolia is more strict regarding this, no errors were caused with 5.5.4.

Tentative location: https://documentation.magnolia-cms.com/display/DOCS55/Release+notes+for+Magnolia+CORE+5.5.6#ReleasenotesforMagnoliaCORE5.5.6-Others 



 Comments   
Comment by Richard Gange [ 11/May/18 ]

I added a "Best practice" box to the release notes about creating a "includes" folder.

While this is our agreed on best practice I have to say that it also creates a bit of confusion in practice. What I have noticed in my training classes is that people will create the "includes" folder. Then subdivide the folder into apps, templates, etc. So now you have two folders called "apps". One is the registry apps and the other is the includes sub-folder. This can get confusing and it's quite easy to start creating an app definition in the includes folder. I've noticed the same thing with decorations.

So you end up with something like this:
my-light-module/apps
my-light-module/inlcudes/apps
my-light-module/decorations/apps

Another approach to this is to keep your includes inside the registries. The trick is to not use dot yaml as the extension. Instead use dot yml, which is still a valid yaml extension. This will keep the scanner from interpreting the snippet as a definition.

So then you have:
my-light-module/apps
my-light-module/apps/inlcudes
my-light-module/decorations/apps

Generated at Mon Feb 12 01:18:40 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.