Problem/Motivation

Per Access checking must be explicitly specified on content entity queries, ::accessCheck() needs to be explicitly called on content entity queries in Drupal 10. There are two places in metatag_open_graph_update_8101() where it is missing. (Granted, it seems very unlikely that many users will not have run this update hook before updating to Drupal 10 in order to hit this error.)

Steps to reproduce

Proposed resolution

Add access checks so queries look like:

          // We found a metatag field, so query for all the entities of this
          // type that have "article_tags" in the serialized array.
          $q = \Drupal::entityQuery($entity_type);
          $q->accessCheck(FALSE);
          $q->condition($field_name, "article_tags", "CONTAINS");
          $count = $q->count()->execute();

and

      $q = \Drupal::entityQuery($entity_type);
      $q->accessCheck(FALSE);
      $q->condition($field_name, "article_tags", "CONTAINS");
      $q->condition($id_col, $last, ">");
      $q->sort($id_col);
      $q->pager(20);
      $res = $q->execute();

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork metatag-3351181

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

godotislate created an issue. See original summary.

godotislate’s picture

Status: Active » Needs review
godotislate’s picture

Issue summary: View changes
damienmckenna’s picture

Status: Needs review » Reviewed & tested by the community
Parent issue: » #3313052: Plan for Metatag 8.x-1.23

Thanks for spotting that and for providing the merge request.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you.

Status: Fixed » Closed (fixed)

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