Parent Issue

#2359437: [meta] Remove entity_load* family of functions usage from the code base

Problem/Motivation

There are cases where entities of the editor entity type are retrieved using the functional loader, entity_load*()

Proposed resolution

Replace calls to entity_load*('editor', ...) with Editor::load*()

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

valthebald created an issue. See original summary.

valthebald’s picture

Beau Townsend’s picture

Working on removing & replacing instances of deprecated entity_load* 'editor' functions.

Beau Townsend’s picture

Status: Active » Needs review
FileSize
8.74 KB

Patch for above issue.

valthebald’s picture

Status: Needs review » Needs work

For entity_load('editor') in tests, please use Editor::load() - it's shorter, and usage of global \Drupal object in tests is discourageed

The last submitted patch, 4: 2723587-4.patch, failed testing.

marvin_B8’s picture

Status: Needs work » Needs review
FileSize
8.1 KB
8.04 KB
John Cook’s picture

Status: Needs review » Needs work

After applying the patch there is still one more use of functional loading:

core/modules/editor/editor.module:252:  $editors = entity_load_multiple('editor');

Editor::loadMultiple() can be used to retrieve multiple entities.

John Cook’s picture

Issue summary: View changes

Updated summary.

marvin_B8’s picture

Status: Needs work » Needs review
FileSize
8.71 KB
546 bytes
snehi’s picture

snehi’s picture

Same timing for Patch coincidence :)

The last submitted patch, , failed testing.

Status: Needs review » Needs work

The last submitted patch, 11: 2723587-10.patch, failed testing.

John Cook’s picture

Status: Needs work » Reviewed & tested by the community

The patches in comments #10 and #11 contain the same changes.

After applying patch #11 there were no more calls to entity_load*() for the editor entity type.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 11: 2723587-10.patch, failed testing.

John Cook’s picture

Status: Needs work » Reviewed & tested by the community

The testbot has passed #11, so setting back to RTBC.

catch’s picture

Status: Reviewed & tested by the community » Fixed

  • catch committed 4c4a039 on 8.2.x
    Issue #2723587 by marvin_B8, snehi, Beau Townsend, valthebald, John Cook...
Wim Leers’s picture

Component: entity system » editor.module

Thank you!

Status: Fixed » Closed (fixed)

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