Problem/Motivation

Follow-up to #2994904: Convert query('SELECT ... FROM {xxx}') to select('xxx')->... in tests
Core should not use direct db calls to entity tables because they are managed by the table mapper entity API.

Proposed resolution

All db_query() and similar should be replaced with \Drupal::entityQuery() or with injected entity storage, and updates/deletes should be done via the Entity API.

From #3012599-11: Replace all db calls to aggregator_feed and aggregator_item tables with Entity APIs:

Potential (non-exhaustive) list of tests affected:

  • core\modules\content_moderation\tests\src\Functional\DefaultContentModerationStateRevisionUpdateTest.php
  • core\modules\node\tests\src\Kernel\NodeAccessRecordsTest.php

DONE:

Remaining tasks

Open child issues for each entity type with code that still has direct db calls to convert them.

User interface changes

no

API changes

no

Data model changes

no

Comments

mondrake created an issue. See original summary.

mondrake’s picture

mondrake’s picture

Status: Fixed » Active
mondrake’s picture

Issue summary: View changes
mondrake’s picture

Issue summary: View changes
mondrake’s picture

Issue summary: View changes

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

mondrake’s picture

Issue summary: View changes
mondrake’s picture

Issue summary: View changes

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

daffie’s picture

daffie’s picture

daffie’s picture

daffie’s picture

daffie’s picture

daffie’s picture

daffie’s picture

daffie’s picture

mondrake’s picture

mondrake’s picture

Issue summary: View changes
daffie’s picture

Issue summary: View changes
andypost’s picture

Looks all child items are fixed

voleger’s picture

Status: Active » Reviewed & tested by the community

#23 Yes, they are fixed.

If no more remaining tasks left then that issue can be marked as fixed.

catch’s picture

Status: Reviewed & tested by the community » Fixed

This didn't need to be RTBC - could just be marked fixed, but great :)

Status: Fixed » Closed (fixed)

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