Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-3554

Thumbnail View in magnolia 5.4 doesn't react anymore to changes in the underlining datasource

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 5.4.3
    • 5.4, 5.4.1
    • workbench
    • Yes
    • Basel 14
    • 5

      Since Magnolia 5.4 (after 5.3 m10) the thumbnail layout is not refreshed properly anymore when the datasource is changed.

      The change in MGNLUI-3373 http://git.magnolia-cms.com/gitweb/?p=magnolia_ui.pub.git;a=commit;h=3183aa0b981bb48aadf6fd48686ea676d662a3db introduces a new "EscalatorThumbnailsPanel" implementation which only initializes the client side panel when the widget is built. The amount of thumbnails is never refreshed and cached thumbnails are not changed even if the item changes in the datasource.

      This change totally broke our UIs based on the previous ThumbnailContainer, which should have been compatible with the new implementation. The worst thing is that at the moment it seems there is no way to force a refresh, even calling refresh() in LazyThumbnailLayout or clearing the cache in LazyThumbnailLayoutConnector is not useful at all.

      For example if you use the thumbnail container to display the content of a specific folder, updating the datasource (selecting a different folder) without destroying/recreating the panel this is what happens:

      1. if you display the content of a folder containing 2 images and then switch to another one which contains 4 images the panel will still display 2 images only (LazyThumbnailLayoutConnector.refreshViewport() called, but cache is not refreshed and the number of html elements not recalculated)
      2. if you display the content of a folder containing 4 images and then switch to another one which contains 2 images only the panel will still show 4 images and only the first two will be refreshed (LazyThumbnailLayoutConnector.refreshViewport() called, but cache is not refreshed and the number of html elements not recalculated)
      3. if you display a folder containing 2 images and switch to another folder containing 2 images nothing happens (refreshViewport() is not even called since the number of items is not changed)

      If not updating automatically there should be at least a way to force a real refresh of the content, however I am not sure what kind of event/notification would be better to use here.

      As a partial patch we fixed it by reinitializing the panel when the "thumbnailAmount" property changes in LazyThumbnailLayoutConnector, however this is not perfect because it only fixes 1) and 2) but doesn't help when the datasource is refreshed without changing the total number of items.

      This is really a blocker for us for properly upgrading to magnolia 5.4, and also patching the widgeset is a real pain...

      It would be great to have at least the attached patch included for magnolia 5.4.2, and if somebody could review the LazyThumbnailLayout implementation in order to properly react even if the number of items is not changed.

        Acceptance criteria

              apchelintcev Aleksandr Pchelintcev
              fgiust Fabrizio Giustina
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD