Problem/Motivation

We have updated to Drupal 10.1.7 and trying to use the 'Export Using content types' to export content, but it throws a PHP error,

Drupal\Core\Entity\Query\QueryException: Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck(). in Drupal\Core\Entity\Query\Sql\Query->prepare() (line 141 of /var/www/opengroup.org/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

So the module does not work at all in 10.1.7

Steps to reproduce

Install Drupal 10.1.7, and node export. Go to 'Content -> Export Nodes -> Using Content Type', and it throws an error

Proposed resolution

It looks like it is linked to : https://www.drupal.org/project/drupal/issues/3357368. So need to call Drupal\Core\Entity\Query\QueryInterface::accessCheck()

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#8 3407066-entity-query-access-check.patch774 bytesuberhacker
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

a.crowe_drupal created an issue. See original summary.

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

tyapchyc’s picture

Status: Active » Needs review

Added access check to query loads nodes of a selected content type.

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

bmagalhaes changed the visibility of the branch 3407066-explicitly-set-whether-the to hidden.

bmagalhaes’s picture

Hi!

It's works. Please, merge in 8.x-1.x branch and generate a new release.

Thanks.

uberhacker’s picture

StatusFileSize
new774 bytes

It didn't work for me but with the attached patch, it works. To apply the patch, add the following to your "patches" section in composer.json and then run composer install.

        "patches":{
            "drupal/node_export": {
                "Entity queries must explicitly set whether the query should be access checked or not": "https://www.drupal.org/files/issues/2023-12-19/3407066-entity-query-access-check.patch"
            }
        },
vinodjethwani’s picture

Status: Needs review » Fixed

Hello,
I applied the patch from comment #8 on my Drupal installation (version 10.1.1), and it resolved the issue successfully.

i-trokhanenko’s picture

Version: 8.x-1.0 » 8.x-1.x-dev
Status: Fixed » Reviewed & tested by the community

@vinodjethwani do not rush to close the issue, the patch is not yet committed!

i-trokhanenko’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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