Problem/Motivation

In #3529219-15: Replace JSON:API Schema dependency with Open API JSON:API module, @ankitv18 discovered a couple of issues. They have not yet been validated. This issue is just to decouple them. I'm copying the original report here verbatim:

I've validated the functionality of this module and found few issues on sorting tab.

When I add the moderation_state

Drupal\Core\Entity\Query\QueryException: 'moderation_state' not found in Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable() (line 373 of /var/www/html/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).

Moderation state

When I add the UUID or Path field getting 400 error in response.

Drupal\Core\Http\Exception\CacheableBadRequestHttpException: Invalid nested filtering. The field `uuid`, given in the path `uuid`, does not exist. in Drupal\jsonapi\Context\FieldResolver->resolveInternalEntityQueryPath() (line 292 of /var/www/html/docroot/core/modules/jsonapi/src/Context/FieldResolver.php).

400 issue

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

traviscarden created an issue. See original summary.

traviscarden’s picture

Note: I have asked @ankitv18 to leave a comment just so the issue credit system knows he contributed.

ankitv18 made their first commit to this issue’s fork.

ankitv18’s picture

Thanks @traviscarden,
I'll validate again with 2.0.x-dev branch to check whether this issue still there.

ankitv18’s picture

Version: 1.0.x-dev » 2.0.x-dev
traviscarden’s picture

@ankitv18 I have confirmed that the bug(s) persist on 2.0.x-dev. And there are actually quite a few fields in addition to the ones you listed that cause the same or similar errors. We'll have to investigate whether they all have a common cause or not.

traviscarden’s picture

Status: Active » Needs review

The problem in both cases was that the "Sort" dropdown was showing invalid options, i.e., options that shouldn't have been in the list to begin with because the endpoint doesn't actually support them. This MR prevents that from happening anymore.

ankitv18’s picture

Assigned: Unassigned » ankitv18
balsama’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! Thoroughly tested locally.

  • balsama committed 4e3383e1 on 2.0.x authored by traviscarden
    [#3545512] fix: Errors when sorting
    
    By: traviscarden
    By: ankitv18
    By:...
balsama’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

traviscarden’s picture

Assigned: ankitv18 » Unassigned

Status: Fixed » Closed (fixed)

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