Image Caption always shows label of field

Created on 20 February 2019, almost 6 years ago
Updated 11 October 2023, about 1 year ago

Photoswipe gives you the option to choose a custom field to use for the caption. However, this field is always displayed with the label of the chosen field.

We would like to just show the content of the field_caption, without displaying the label, but there does not seem to be a setting for that, nor does it respect the field/label visibility settings.

🐛 Bug report
Status

Closed: duplicate

Version

4.0

Component

Code

Created by

🇧🇪Belgium mathysp

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇪Belgium Yanivs

    Hi,

    I had this problem with D9.3.0 and photoswipe 3.1.4.

    Updated to photoswipe 3.2.4 and the problem is not solved.

    When selecting "Photoswipe image caption" = "Image alt tag" the label of the image alt field is not displayed.

    When selecting "Photoswipe image caption" = "field_caption", a custom field I added to the media type, the field's label, "Caption", is displayed together with the field's value (see attached image).

    In "Manage display" section of the media type, the label of caption_field is set to hidden, so it should not appear.

    Thanks in advance for fixing this and please let me know if you need more information.

  • Status changed to Active almost 2 years ago
  • 🇩🇪Germany Anybody Porta Westfalica

    @Yanivs thank you very much. So I'll reopen this.

    Could you please then add a test which proves the wrong behaviour, so we can clearly fix it for the future? That would be super helpful.
    There are many tests existing in the module, which should give you a good starting point.

  • 🇩🇪Germany Anybody Porta Westfalica

    Could you please create a test to show this issue? The module seems simple but has become quite complex for the many cases including media, responsive images etc. so we need tests to ensure nothing breaks in the future and proof something is broken.

    Thanks you :)

  • Status changed to Needs work over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    3.x is now 4.x! :)

    NW as of #31

  • 🇩🇪Germany Anybody Porta Westfalica

    As soon as someone provides the required tests, we can proceed here. Also someone could check if the issue is resolved in 5.x then we could decide to close this and use 5.x instead.

  • Status changed to Postponed: needs info about 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Please let us know, if the issue still exists in 5.x

  • 🇩🇪Germany Anybody Porta Westfalica

    Has been fixed in 5.x: 🐛 Photoswipe Caption: Selected source field is printed including the field label (no matter if the label is turned off in the field configuration) Needs work

    If anyone needs a backport, feel free to cherry-pick as MR.

  • Status changed to Closed: duplicate about 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica
Production build 0.71.5 2024