Details
-
Bug
-
Resolution: Done
-
Neutral
-
None
-
None
-
None
-
None
Description
Steps to reproduce
- Go to https://docs.magnolia-cms.com/product-docs/6.2/Modules/List-of-modules/Observation-module.html#_example_activating_assets_automatically
- Add an observer as suggested. (Note that the configuration is only listed as an image, which is rather annoying.)
- Go to the assets app.
- Create a folder.
- Publish the folder.
- Select the folder.
- Click the button to upload a Zip archive.
- Pick a Zip archive containing several images, not nested in a folder.
- Check “Extract here”
- Hit the upload button.
- Check the server logs.
.. Logs, screenshots, gifs...
Expected results
.. Justify non-trivial expectations with a link to a doc or a relevant discussion.
The publication should have succeeded, with no errors logged.
Actual results
One of the publications may fail due to a race condition, as multiple publications of the parent folder happen concurrently. The root cause, as seen in public, is an org.apache.jackrabbit.core.state.StaleItemStateException.
Workaround
Use the SpecifiedNodeTypeOnly listener, which also allows automatically publishing folders, while at it:
'autoActivateAssets': 'active': 'true' 'description': 'Automatically activate new assets & folders' 'eventTypes': 'NODE_ADDED' 'includeSubNodes': 'true' 'path': '/' 'repository': 'dam' 'listener': 'class': 'info.magnolia.module.observation.commands.SpecifiedNodeTypeOnlyEventListener' 'includes': - 'mgnl:asset' - 'mgnl:folder' 'command': 'class': 'info.magnolia.publishing.command.PublicationCommand' 'params': 'repository': 'dam'
Development notes
Checklists
Acceptance criteria