core icon indicating copy to clipboard operation
core copied to clipboard

UVE: Image management issue with language toggle for secondary languages

Open dcolina opened this issue 1 year ago • 2 comments

Parent Issue

No parent issue identified.

Problem Statement

There is an error when using the language toggle to manage images for a secondary language. For example, in the case of the "banner" content type, when an image is added to the primary language, it displays correctly. However, when an image is added to a secondary language, it does not appear. Although switching between pages works correctly, there is a bug in managing the image for the secondary language. This issue occurs consistently across all three supported browsers: Chrome, Firefox, and Edge.

Steps to Reproduce

  1. Deploy the dotCMS instance using the Docker image dotcms/dotcms:trunk_fbad538.
  2. Open the dotCMS instance.
  3. Navigate to a "banner" content type and add an image in the primary language.
  4. Verify that the image displays correctly.
  5. Switch to a secondary language using the language toggle.
  6. Add an image for the secondary language.
  7. Observe that the image does not display.

Acceptance Criteria

  1. When adding an image to a secondary language for a content type (e.g., "banner"), the image should:
    • Display correctly in the secondary language view.
    • Be managed properly without any errors or discrepancies between languages.
    • Ensure that the language toggle functionality works seamlessly with images.

dotCMS Version

Tested with Docker image dotcms/dotcms:trunk_fbad538.

Proposed Objective

User Experience

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

  • Attached video showing the issue with image management when switching languages.

https://github.com/user-attachments/assets/7932ef5b-c45e-4d1a-888e-1a1a8acc2335

Assumptions & Initiation Needs

  1. Ensure that the environment is set up to manage multiple languages.
  2. Confirm that the content type ("banner") and images are available for testing in multiple languages.

Quality Assurance Notes & Workarounds

No workaround is currently available. The issue persists when attempting to manage images for secondary languages.

Sub-Tasks & Estimates

  • [ ] Investigate the cause of the image not displaying when added to a secondary language.
  • [ ] Identify and implement a fix to ensure images are managed correctly across all languages.
  • [ ] Test the fix across all supported browsers: Chrome, Firefox, and Edge.

dcolina avatar Sep 03 '24 16:09 dcolina

Probably something in our example image component, please check in Angular and Astro as well.

fmontes avatar Sep 03 '24 21:09 fmontes

Note to QA: Please, additionally test case # 30 of the Regression Tests spreadsheet

nollymar avatar Sep 06 '24 22:09 nollymar

PRs:

  • https://github.com/dotCMS/core/pull/30561
  • https://github.com/dotCMS/core/pull/30587

github-actions[bot] avatar Nov 04 '24 14:11 github-actions[bot]

Note to QA:
We have fixed the fallback mechanism to default language if an image or file associated with a contentlet does not exist in the contentlet's current language.

To test this:

  1. Ensure that the DEFAULT_FILE_TO_DEFAULT_LANGUAGE property is set to true in the environment configuration.
  2. Create a Spanish version of a contentlet with an Image Field. Select an image that doesn’t have a Spanish version.
  3. Add the contentlet to a Spanish page.
  4. Verify that the contentlet-associated image displays properly.

valentinogiardino avatar Nov 08 '24 13:11 valentinogiardino

IQA Passed

Now the image can be accessed even if we do not have a version for the specified language

DotCMS Docker Image: [dotcms/dotcms:trunk_9269649]

Screenshot

https://github.com/user-attachments/assets/26942a57-019c-4bc9-a232-fda6f834813f

zJaaal avatar Nov 08 '24 17:11 zJaaal

We need some work here:

I noticed there have been some changes after the IQA. Hopefully not, but these changes could potentially break some functionality

There’s a comment about retesting the specific test cases for this functionality in the provided CSV, but we haven’t updated the actual test results after this fix

bryanboza avatar Nov 19 '24 21:11 bryanboza

IQA Passed

Results for Test Case #30

Headless

https://github.com/user-attachments/assets/ea009e50-abec-4945-96af-3074fa5c32e3

Traditional

https://github.com/user-attachments/assets/7002f84f-2a98-44f8-9eaf-03fdfb413ea5

zJaaal avatar Nov 20 '24 13:11 zJaaal

Note to QA

In the headless version, images may fail even if the image exist in the specified language, our way to manage images in the examples it's too naive and it's not bulletproof. We are aware of this problem and we will take care of it in this ticket https://github.com/dotCMS/core/issues/30717

zJaaal avatar Nov 20 '24 14:11 zJaaal

we can pass this one for now, but will need be retested after the fix the #30717

bryanboza avatar Nov 20 '24 18:11 bryanboza