[MSITEMESH-54] mgnl:injecturi element unwantedly rendered during direct component access Created: 17/Oct/17  Updated: 05/May/22

Status: Open
Project: SiteMesh
Component/s: None
Affects Version/s: 1.1.1
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Bence Vass Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

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
Date of First Response:

 Description   

When defining a fragmentDefinition for a component, and accessing that component with direct component access, unwanted code is rendered into the source code.

F.e. adding a fragmentDefinition to jumbotron.yaml
fragmentDefinition:
class: info.magnolia.module.advancedcache.rendering.DynamicFragmentDefinition
ttl: 0
mechanism: sitemesh
dynamic: true

When accessing that component directly (can't be tested on magnolia demo, because sitemesh module is not installed):
https://demo.magnolia-cms.com/sportstation/about/main/0

There is unwanted code in the beginning of the source code

<mgnl:injecturi target="/sportstation/about/main/0" X-Magnolia-Cache="ttlValue=0,CacheKeyGenerator=,">

This can cause serious problems, f.e. when rendering XML or JSON files via component variation, which are then invalid.



 Comments   
Comment by Roman Kovařík [ 17/Oct/17 ]

Hello bvass

do you use dynamic fragments for XML or JSON requests? Can't you just bypass the sitemesh filter for these extensions?

Regards
rkovarik

Comment by Bence Vass [ 17/Oct/17 ]

Hi,

yes I can do that, I can also set dynamic to false for the variation.

That was just an example where this bug can cause problems, but I think it is still a bug.

Only the opening tag is rendered, not the closing one. It also doesn't happen during direct area access.

BR Bence

Comment by Ioannis Spyronis [ 26/Nov/19 ]

Hi,

Is there any update on that?

I have added maven module for https://documentation.magnolia-cms.com/display/DOCS56/Advanced+Cache+Dynamic+Page+Caching

together with:
https://documentation.magnolia-cms.com/display/DOCS56/SiteMesh+module

I noticed that without adding any fragmentDefinition on a component/ area I am seeing <mgnl:injecturi target=" .. rendered on random components of my page.

(p.s. The component I am seeing that has variants)

Comment by Roman Kovařík [ 05/May/22 ]

Hey

This ticket is about direct component/area rendering.
This should not happen with correct configuration when rendering whole pages.
Could you add steps to reproduce for your issues?

Roman

Generated at Mon Feb 12 10:57:21 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.