[MGNLCAMPU-107] Publish campaign doesn't work Created: 16/Mar/23  Updated: 18/May/23  Resolved: 11/May/23

Status: Closed
Project: Campaign Publisher
Component/s: None
Affects Version/s: 2.0.2
Fix Version/s: 2.0.4

Type: Bug Priority: Neutral
Reporter: Jonathan Ayala Assignee: Oanh Thai Hoang
Resolution: Fixed Votes: 0
Labels: quickwin
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 2d 4.75h Time Spent: 1d 6.25h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: XML File config.modules.campaign-publisher.commands.xml    
Issue Links:
causality
caused by MGNLCAMPU-97 Provide new decorations for UI 6 page... Closed
relation
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLCAMPU-110 Implement Sub-task Closed Oanh Thai Hoang  
MGNLCAMPU-111 Review Sub-task Closed Jaroslav Simak  
MGNLCAMPU-112 piQA Sub-task Completed Phong Le Quoc  
MGNLCAMPU-113 qa Sub-task Completed Milan Divilek  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* 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:
Epic Link: Support
Sprint: DevX 37
Story Points: 3
Team: DeveloperX
Work Started:
Approved:
Yes

 Description   

Steps to reproduce

  1.  Go to campaign publisher in demo author
  2.  Mark as ready all items under campaign new years eve
  3. Publish campaign

Expected results

Items are published

Actual results

Nothing happens

Workaround

Add the activate command configuration to JCR (configuration app) config.modules.campaign-publisher.commands.xml

Development notes

This is happening because command activate from catalog campaign-publisher is not registered. Configuration of this command resides in yaml file. When debugging you can see the following exception thrown in info.magnolia.ui.framework.action.AbstractCommandAction.executeOnItem(JcrItemAdapter):

Could not find command activate in any catalog

The actual issue occurs when instantiating the command in info.magnolia.ui.framework.action.AbstractCommandAction.AbstractCommandAction(D, List<JcrItemAdapter>, CommandsManager, UiContext, SimpleTranslator)

 

incl. create test to cover CAMPU publishing 



 Comments   
Comment by Oanh Thai Hoang [ 28/Apr/23 ]

Discovery output:

 

This bug happen since https://jira.magnolia-cms.com/browse/MGNLCAMPU-97

Commands can not register via YAML in light dev resource because command definition only support register via jcr and from bootstrap resource folder. See  command manager java doc below

* Manages configured commands and command catalogs and performs execution of commands. Monitors configuration
 * of commands and catalogs in JCR within each module under a node named <code>commands</code>

 

Suggestion: Add to mgnl-bootstraps folder and create a task to bootstraps commands again if missing. PR is created

Comment by Milan Divilek [ 10/May/23 ]

QA: If commands already exists then they are rebootstrapped. This should not happen, if someone has modified command we would change behaviour for them.

Reproduce:
1. Rename /modules/campaign-publisher/commands/campaign-publisher/addToCampaign to test
2. Change /modules/campaign-publisher@version to 2.0.3
3. Restart instance and trigger update
4. Check /modules/campaign-publisher/commands/campaign-publisher. test node doesn't exist anymore and addToCampaign is back

Caused:
It doesn't matter what importUUIDBehavior is set in BootstrapSingleResource task, because if node already exist it's first removed and bootstrapped again. See BootstrapUtil

Solution:
We need to add check if commands exist before bootstrap. For example via info.magnolia.module.delta.NodeExistsDelegateTask

Generated at Sun Feb 11 23:57:29 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.