-
Bug
-
Resolution: Fixed
-
Neutral
-
2.1.7
-
None
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.
Acceptance criteria