Problem/Motivation

Hello Ivan. After the update, empty tokens began to be displayed if the description is missing. Before the update, empty tokens were not displayed.
https://drive.google.com/file/d/12SQfPv4RXKMOp5twW4w2YXslBskdhPuE/view?u...

Thank you.

Comments

n-i created an issue. See original summary.

levmyshkin’s picture

Hello n-i, it must be media:* entity is not accessible in tokens. This field media:field_description is in media entity or in parent paragraph?
I updated logic for getting values from parent entities:
https://www.drupal.org/project/glightbox/issues/3511270

n-i’s picture

This is a media entity field. It is available in tokens. It's just that empty tokens are not removed. Usually empty tokens are removed and the field is not output, but here the field is output with an empty token.
https://drive.google.com/file/d/1kQkr6UpUSY2oOSzH2wWYOIdrefj4QINZ/view?u...
https://drive.google.com/file/d/1hcZdYJTw-eWbBn1qXSLQFJxDbcCjRxM_/view?u...

levmyshkin’s picture

I found the problem:

   *   - clear: A boolean flag indicating that tokens should be removed from the
   *     final text if no replacement value can be generated.

It was set as FALSE, I changed it to TRUE and pushed changes in a new release:
https://www.drupal.org/project/glightbox/releases/1.0.15

It's working fine for me now. You need to update drupal/glightbox module with composer:
composer update drupal/glightbox

levmyshkin’s picture

Status: Active » Fixed
levmyshkin’s picture

Status: Fixed » Closed (fixed)
n-i’s picture

Everything's great. Thank you.