[MAGNOLIA-1092] Corrupted pages after executing a workflow command Created: 27/Sep/06  Updated: 23/Jan/13  Resolved: 27/Oct/06

Status: Closed
Project: Magnolia
Component/s: workflow
Affects Version/s: None
Fix Version/s: 3.0 RC4

Type: Bug Priority: Major
Reporter: Fabrizio Giustina Assignee: Fabrizio Giustina
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: JPEG File screenshot.jpg    
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   

During the execution of a workflow command the standard magnolia context is wrapped in a WorkItemContext and, for this reason, pages shown after the execution of the command are broken.

The reason is that MgnlContext.getContextPath() only works when the context is an instance of WebContextImpl and returns an empty String when it finds the WorkItemContext implementation (although it wraps a WebContextImpl). This makes javascript and images links broken.



 Comments   
Comment by Fabrizio Giustina [ 27/Sep/06 ]

screenshot of the inbox page after a workflow command execution.
missing context path due to the behaviour of MgnlContext.getContextPath().

Comment by Fabrizio Giustina [ 27/Sep/06 ]

Partially fixed in MgnlContext by unwrapping an eventual wrapped web context.
Still not working since the wrapped context during a workflow execution is a System Context :/

There is a note and a TODO in info.magnolia.module.workflow.MgnlParticipant:

// set parameters in the context
// precise what we're talking about here: this is forced to be a System Context :
// since we are processing within the workflow enviroment
// TODO: fix this by using a proper workflow context
Context context = MgnlContext.getSystemContext();
context = new WorkItemContext(context, wi);

Any reason for not changing the first call to MgnlContext.getInstance() instead of MgnlContext.getSystemContext()?

Philipp? Nico? Any hint?

Comment by Philipp Bracher [ 28/Sep/06 ]

MgnlContext.getInstance() will fall back to the SystemContext normally (notice this well known warning log).

I'm a bit confused because I thought the following code would always be true, but as you descibe it isn't:

MgnlContext.hasInstance() == false

Anyway we must save the original context and reset it afterward (setting to null if none was set).

Comment by Fabrizio Giustina [ 06/Oct/06 ]

fixed in svn

Comment by Magnolia International [ 27/Oct/06 ]

reopening to change fix version to rc4

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