[CONTEDIT-596] The composition nodetype missing from custom_nodetypes Created: 20/Nov/23  Updated: 24/Jan/24  Resolved: 04/Dec/23

Status: Closed
Project: Content Editor
Component/s: None
Affects Version/s: 2.1.7
Fix Version/s: 2.2.0, 2.1.8

Type: Bug Priority: Neutral
Reporter: Richard Gange Assignee: Thuy To
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 1d 7.5h
Original Estimate: Not Specified

Issue Links:
causality
relation
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
Epic Link: AuthorX Support
Story Points: 2
Team: AuthorX
Work Started:
Approved:
Yes

 Description   

There can be cases where the composition nodetype goes missing. It should be possible to regenerate the nodetypes file without needing an installation/upgrade.

Reproduce

  • Install Magnolia
  • Shut down
  • Delete the custom_nodetypes.xml file (/magnolia-dx-core-demo-6.2.39/apache-tomcat-9.0.80/webapps/magnoliaAuthor/repositories/magnolia/repository/nodetypes/custom_nodetypes.xml)
  • Start up

Expected
The mgnl:composition nodetype should be available.

Actual
The nodetype is missing which can lead to:

NoSuchNodeTypeException: {http://www.magnolia.info/jcr/mgnl}composition

Workaround
Regsiter the nodetypes manually running this Groovy script:

import info.magnolia.objectfactory.Components;
import info.magnolia.repository.Provider;
import info.magnolia.repository.RepositoryManager;

RepositoryManager repositoryManager = Components.getComponent(RepositoryManager.class);
Provider repositoryProvider = repositoryManager.getRepositoryProvider("magnolia");
repositoryProvider.registerNodeTypes("/mgnl-nodetypes/content-editor-nodetypes.cnd"); 

Notes
The problems stems from the fact the nodetype is only registered through code now. We need the nodetype registered through a file configuration as well.


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