Undefined array key in Drupal\sparql_entity_storage\Entity\Query\Sparql\Query->getGraphUris()

Created on 25 September 2023, 9 months ago
Updated 26 September 2023, 9 months ago

Problem/Motivation

The SPARQL query breaks when a bundle filter is provided for a non existing bundle key.

Steps to reproduce

Tests provided in the PR.

Proposed resolution

Now, this is a bit tricky. One thought is to return an empty string of entities in case the bundle key filter is invalid. However, that would not be effective in negative conditions, or in nested conditions. Thus, I suggest that if an invalid bundle is provided, a random hashed URI will be used instead so that if the invalid bundle is required (=), then no entity will match the type, whereas if the bundle is mandatory to be different (!=), then all entities will have a different bundle. Same for 'IN', 'NOT IN' etc.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡·Greece idimopoulos

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

Comments & Activities

Production build 0.69.0 2024