core icon indicating copy to clipboard operation
core copied to clipboard

Image Selector Issues

Open erickgonzalez opened this issue 2 years ago • 2 comments

Describe the bug When a content type has an image field, and the image uploaded to a specific directory is multilingual, the image selector is presenting 2 issues: 1- Since it pulls the first 24 images without respecting the language, it only shows the ones of the respective language. E.g pulls 24 images, but only 3 of them are in English, so only show 3. 2- The Total file amount is showing all the images regardless of the language. E.g there are 4 images, each one in English and Spanish, so if shows a Total of 8 but the UI only shows 4.

To Reproduce Steps to reproduce the behavior:

  1. Start dotcms with a full starter.
  2. Create the Italian, German, French, and Japanese languages.
  3. Go to Site Browser > Images > Gallery > Winter
  4. For each of the images, create a version for each language.
  5. Create a Content Type that only has an Image Field.
  6. Create content of the created content type.
  7. See that not all images are showing.
  8. See the Total is wrong.

Note: Contact me for a bundle that might be helpful.

Expected behavior Should only pull images that are in the requested language.

Screenshots

https://user-images.githubusercontent.com/5278970/183963582-ade8038c-f65b-4ec4-814e-d7953f2160ec.mov

Reproducible in the demo site (22.08), and 22.03 LTS Customer ticket https://dotcms.zendesk.com/agent/tickets/108083

Acceptance Criteria

  1. It should list the images in the selector with the language that the contentlet is being edited AND the default language images.

erickgonzalez avatar Aug 10 '22 16:08 erickgonzalez

Hey team! Please add your planning poker estimate with Zenhub @hmoreras @jcastro-dotcms @jdotcms @rjvelazco

fmontes avatar Sep 09 '22 16:09 fmontes

#esonometocami

here there are 26 items --> Spa & Eng image

when trying to add a new image in a new contentlet image

the fetch sends this on the payload

%2Fc%2Fportal%2Flayout%3Fp_l_id%3D71b8a1ca-37b6-4b6e-a43b-c7482f28db6c%26p_p_id%3Dcontent%26p_p_action%3D1%26p_p_state%3Dmaximized%26angularCurrentPortlet%3Dcontent%26p_p_mode%3Dview%26_content_struts_action%3D%252Fext%252Fcontentlet%252Fedit_contentlet%26_content_cmd%3Dnew%26_content_referer%3D%252Fc%252Fportal%252Flayout%253Fp_l_id%253D71b8a1ca-37b6-4b6e-a43b-c7482f28db6c%2526p_p_id%253Dcontent%2526p_p_action%253D1%2526p_p_state%253Dmaximized%2526angularCurrentPortlet%253Dcontent%2526_content_struts_action%253D%252Fext%252Fcontentlet%252Fview_contentlets%26_content_inode%3D%26selectedStructure%3D70579bcafb5e6fc2f7ec7f510d65f835%26lang%3D1%26in_frame%3Dtrue%26frame%3DdetailFrame%26container%3Dtrue%26angularCurrentPortlet%3Dcontent
scriptSessionId=7f29Sc5CTXZzJvJ2M10pM$Lwhbo/V8xezco-bHKizcX8s

decoded is (it has the lang param to 1)

/c/portal/layout?p_l_id=71b8a1ca-37b6-4b6e-a43b-c7482f28db6c&p_p_id=content&p_p_action=1&p_p_state=maximized&angularCurrentPortlet=content&p_p_mode=view&_content_struts_action=%2Fext%2Fcontentlet%2Fedit_contentlet&_content_cmd=new&_content_referer=%2Fc%2Fportal%2Flayout%3Fp_l_id%3D71b8a1ca-37b6-4b6e-a43b-c7482f28db6c%26p_p_id%3Dcontent%26p_p_action%3D1%26p_p_state%3Dmaximized%26angularCurrentPortlet%3Dcontent%26_content_struts_action%3D%2Fext%2Fcontentlet%2Fview_contentlets&_content_inode=&selectedStructure=70579bcafb5e6fc2f7ec7f510d65f835&lang=1&in_frame=true&frame=detailFrame&container=true&angularCurrentPortlet=contentscriptSessionId=7f29Sc5CTXZzJvJ2M10pM$Lwhbo/V8xezco-bHKizcX8s

but the response TOTAL items is taking in consideration all the items in general image

so pagination count is not using languageId, so that's why the TOTAL does not match the displayed items

alfredo-dotcms avatar Sep 09 '22 17:09 alfredo-dotcms

image image image

image Paginating with page size of 12 image Totals matching: image

victoralfaro-dotcms avatar Nov 02 '22 20:11 victoralfaro-dotcms