Problem/Motivation

Found in #2491989: [PP-1] Use the 'uuid' database schema type (with native PostgreSQL implementation) for UUID fields

Note: Marking this as a task for the entity system, as my presumption is that JSON:API's usage is fine, we just need to update the documentation. Alternatively this could be seen as a bug in JSON:API if its usage is in fact deemed incorrect.

Per the documentation there is no NOT BETWEEN operator in the entity query system. \Drupal\Core\Entity\Query\QueryAggregateInterface::conditionAggregate() documents BETWEEN but not its inverse.

However, \Drupal\jsonapi\Query\EntityCondition::$allowedOperators does contain NOT BETWEEN, and \Drupal\Tests\jsonapi\Unit\Query\EntityConditionTest does test that it in fact works.

Steps to reproduce

-

Proposed resolution

Either:
Add the NOT BETWEEN operator to the documentation in \Drupal\Core\Entity\Query\QueryAggregateInterface::conditionAggregate().

Or:
Remove support for NOT BETWEEN from JSON:API.

Remaining tasks

User interface changes

-

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#6 3256056-6.patch858 bytesandregp
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tstoeckler created an issue. See original summary.

andregp’s picture

Assigned: Unassigned » andregp

The project https://www.drupal.org/project/jsonapi is deprecated so I don't believe that the core function (QueryAggregateInterface::conditionAggregate()) should be changed to follow jsonapi. I'm also not sure if it's really needed to correct/update the jsonapi for the same reason, so, IMO I would vote for closing this issue.

andregp’s picture

Assigned: andregp » Unassigned

Sorry, assigned by mistake

tstoeckler’s picture

@andregp: Thanks for the feedback. I think you are misunderstanding something, though. Or I am misunderstanding your comment, not sure. In any case: The contributed JSON:API module that you linked to is deprecated, yes, but only because it moved into Drupal core. And the JSON:API module in Drupal core contains the same code. So yes, I do believe it makes sense to either adapt the JSON:API usage of the entity query API as it is currently documented or (preferred) to adapt the documentation of the entity query API and, thus, make JSON:API's usage "official".

andregp’s picture

@tstoeckler I'm sorry. You're absolutely right. I was confused and didn't know about the JSON:API being moved to core.

andregp’s picture

Status: Active » Needs review
FileSize
858 bytes

This patch adds NOT BETWEEN into the QueryAggregateInterface.php documentation.

beatrizrodrigues’s picture

Assigned: Unassigned » beatrizrodrigues

I'll do the review

beatrizrodrigues’s picture

Assigned: beatrizrodrigues » Unassigned
Status: Needs review » Reviewed & tested by the community

Seems good to me, there is no phpcs problems and as there is usage of NOT BETWEEN the documentation probably needed that indeed. RTBC to me.

xjm’s picture

Version: 10.0.x-dev » 9.2.x-dev

Documentation improvements are patch-eligible fixes, so unless this documentation only exists in D10, the fix should be backported all the way to 9.2.x and filed against that branch. 10.0.x should only be used for changes that cannot be made in D9 (e.g., major dependency updates, removing deprecated code). Thanks!

alexpott’s picture

Version: 9.2.x-dev » 9.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 1cf95460d9b to 10.0.x and f75ef8ce27a to 9.4.x and 5a4f3c8bc7f to 9.3.x. Thanks!

Backported to 9.3.x as that's the current bugfix branch and this is a docs patch.

  • alexpott committed 1cf9546 on 10.0.x
    Issue #3256056 by andregp: Entity query system does not document the NOT...

  • alexpott committed f75ef8c on 9.4.x
    Issue #3256056 by andregp: Entity query system does not document the NOT...

  • alexpott committed 5a4f3c8 on 9.3.x
    Issue #3256056 by andregp: Entity query system does not document the NOT...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.