Skip to content

Bug: verify if metadata display entity set via config ymls still exist before generating demo URL on exposed endpoint #86

@DiegoPino

Description

@DiegoPino

What is this?

A long title for a simple issue:

here https://github.com/esmero/format_strawberryfield/blob/master/src/Entity/Controller/MetadataExposeConfigEntityListBuilder.php#L58

We don't verify if the loaded defaults still apply. Issue is that we allow settings to be set via YAML but there is not further/post validation. Because of that if an exposed endpoint is configured to use a given Metadata display entity ID, and that one is missing you get a whitescreen on /admin/config/archipelago/metadataexpose

Error: Call to a member function get() on null in Drupal\format_strawberryfield\Entity\Controller\MetadataExposeConfigEntityListBuilder->getDemoUrlForItem() (line 98 of /var/www/html/web/modules/contrib/format_strawberryfield/src/Entity/Controller/MetadataExposeConfigEntityListBuilder.php)
#0 /var/www/html/web/modules/contrib/format_strawberryfield/src/Entity/Controller/MetadataExposeConfigEntityListBuilder.php(63): 

This is a bug. I just removed a stray/orphan config from esmero/archipelago-deployment@c48e827. So if you are there, do a git pull and sync or simply edit your config.

Code solution is to check and disable if no metadata display entity exists for the configured endpoint. IF you encounter this problem then adding an empty template with missing ID also serves the purpose or even removing the config/setting config to an existing one via configuration sync.

Long term solution is to store UUIDs on the config (needed, not numeric ids !) and always check

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions