Not possible to exclude selected media bundles

Created on 11 August 2023, 11 months ago
Updated 14 September 2023, 10 months ago

Problem/Motivation

I have tried to exclude 1 media bundle to directly show the media file, and it does not seem to work.

Steps to reproduce

Try the config on /admin/config/media/media_alias_display page.

Proposed resolution

I think there is a problem with checking the checkbox values stored in the config.

https://git.drupalcode.org/project/media_alias_display/-/blob/1.0.x/src/...
https://git.drupalcode.org/project/media_alias_display/-/blob/1.0.x/src/...
The allowed_bundle value is checked for 0 (integer) but the config stores the value as '0' (string).
https://git.drupalcode.org/project/media_alias_display/-/blob/1.0.x/conf...

solution:
Instead of $allowed_bundle !== 0 use !empty($allowed_bundle)
Instead of $allowed_bundles[$media_bundle] === 0 use empty($allowed_bundles[$media_bundle])

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡­πŸ‡ΊHungary Pasqualle πŸ‡­πŸ‡Ί Budapest

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024