Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCU-2888

Documentation on automatic asset publication suggests broken configuration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Neutral
    • None
    • None
    • None
    • None

    Description

      Steps to reproduce

      1. Go to https://docs.magnolia-cms.com/product-docs/6.2/Modules/List-of-modules/Observation-module.html#_example_activating_assets_automatically
      2. Add an observer as suggested. (Note that the configuration is only listed as an image, which is rather annoying.)
      3. Go to the assets app.
      4. Create a folder.
      5. Publish the folder.
      6. Select the folder.
      7. Click the button to upload a Zip archive.
      8. Pick a Zip archive containing several images, not nested in a folder.
      9. Check “Extract here”
      10. Hit the upload button.
      11. 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

        Attachments

          Activity

            People

              abrooks Adrian Brooks
              dvpc Dan Christiansen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR