Not sure if this is an issue with Discussion Post sidebar (Document/Media) or something that happens into Media Gallery or Discussion view.

Step to reproduce:
(1) Create a Files Section into a Space
(2) Create a Folder into the Files Section
(3) Upload two images
(4) Check all is OK (two files are added and shown inside the Folder created in step (2))

Now let's say we need a way to easily show uploaded pictures through theirs thumbnails and, to manage this request, we create a Discussion Post in a Discussion Section in which, through the Add Media Gallery Paragraph (Attach Media), we will link those two pictures. Maybe there is another way to realize a preview of some library's pictures but, at this moment, I ignore it.

So:

(5) Create a Discussion Section
(6) Create a new Post
(7) while creating the Post add a Media Gallery Paragraph, then Attach Media -> Browse
(8) Select Library (two pictures were shown)
(9) Select the two pictures uploaded on step (3)
(10) Save the Post.

Now, looking at it, there are two pictures on the Post's body as expected, and four (the same two pictures repeated two times) in the sidebar under Document/Media pane just below the Content Visibility pane.

Why?

What is confusing users is that not only the two pictures are repeated two times but also that the pictures total number when in "preview mode" (by clicking on any one of them) shows 6 and not only 2 as should be and user can really move between 1 to 6 (pictures repeat) as pictures were really 6 and not 2.

See screenshots.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dpoletto’s picture

Title: Attach Media to Media Gallery shows three times the number of pictures really uploaded. » Discussion Post view shows three times the number of pictures really uploaded through Media Gallery Paragraph.

Changed title to better describe what's happening and where it happens.

hefox’s picture

I believe the view can be removed both via the geneirc discussion post panelizer layout or customizing the discussion node itself, but it is a bug that it is showing duplicates. The view is suppose to show any media attached to the discussion node or any comment replies, and is a rather complicated via (has to look in paragraphs, attachments, and paragraphs on comments..), so not surprised that there is a bug that it's showing duplicates.

dpoletto’s picture

Hi Hefox, If it is a bug it seems to hit the page view when the viewer is either the Site Admin or the user who created the content type with that relevant Media Gallery: other users that can access and reply to that content type see only the published (*) pictures.

Didn't found a way to remove that "view" (via generic discussion post panelizer layout or by customizing the discussion node itself): discussion section doesn't show anything special (apart the usual Content Visibility pane) on the sidebar on the right, so it does the discussion post itself; the discussion post Panelizer Layout settings are like dark matter for me (better not to touch!).

(*) = If n is the number of published pictures shown through Media Gallery in the content body - let's say a Discussion Post - then n^2 will be the number of pictures shown on the right side on the page sidebar (as thumbnails) for the user that created that content.
This means that...that user will see a total number of pictures shown in the whole page that will be n+n^2. As example, for only 3 pictures attached that page will be forced to reproduce a total of 12 images: 3 intended pictures and their 9 related thumbnails, repeated in three groups of 3 each one.

I didn't tested with other type of attached files.

dpoletto’s picture

Title: Discussion Post view shows three times the number of pictures really uploaded through Media Gallery Paragraph. » Discussion Post view shows n^2 times more the number n of pictures really attached through Media Gallery Paragraph to content creator.

Updated the issue Title to reflect what happens.

mpotter’s picture

Yep, reproduced this. Looking into it.

mpotter’s picture

Status: Active » Fixed

Fixed this in commit 1deadb3 of oa_comment. Also updated the view to show the proper comment # as a link, and fixed the filename link to link to the actual raw file instead of the comment or node.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.