In #1184272: Remove deprecated $conditions support from entity controller we removed $conditions from entity_load_multiple(). Interestingly though, instead of actually removing it after it has already been marked as @deprecated in D7 we added a new method to EntityStorageControllerInterface called EntityStorageControllerInterface::loadByProperties() as well as another wrapper called entity_load_multiple_by_properties(). Additionally, this comes with another utility method named ->buildPropertyQuery(). So, to summarize: Instead of curing the problem with $conditions we actually just moved it to somewhere else by introducing a new method as well as a wrapper, which, by the way is just a wrapper for entity_query() itself anyways (which itself is a wrapper for the DIC)...

CMI currently has a custom work-around for this to bypass EFQ but once #1846454: Add Entity query to Config entities we should remove this stuff altogether and simply tell people to use EFQ for loading things by properties.

Also related:
#1893442: Move BlockStorageController::loadByProperties() into ConfigStorageController

CommentFileSizeAuthor
#2 drupal-1887058-2.patch517 bytesdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fubhy’s picture

Issue summary: View changes

Updating issue summary.

fubhy’s picture

Issue summary: View changes

Updated issue summary.

tim.plunkett’s picture

Status: Active » Postponed

This is currently needed by blocks, and is being moved up a level for all config entities: #1893442: Move BlockStorageController::loadByProperties() into ConfigStorageController

So, postponing on #1846454: Add Entity query to Config entities, since both storage controllers would need entity_query support first.

dawehner’s picture

Status: Postponed » Needs review
FileSize
517 bytes

As issues still maybe add usage to that function / maybe contrib already start to port stuff (as an example #916388: Convert menu links into entities)
I would suggest to add an @deprecated for now and slowly remove all the usage to finally remove it.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

That sounds like a plan. :-)

sun’s picture

Status: Reviewed & tested by the community » Needs review

I do not understand this issue. Can we get a better + more concise summary? To clarify what the actual problem is?

fubhy’s picture

@sun: There is no point in having multiple levels of these pointless wrappers. We got entity field query, let's simply use it directly. In fact, I would even vote for removing the loadByProperties() method. It's simply not the job of the storage controller to do that.

ParisLiakos’s picture

#2: drupal-1887058-2.patch queued for re-testing.

Berdir’s picture

Not convinced.

This does use EFQ internally, so the problem that $conditions had (not being able to cache it properly), is solved. So the issue summary is not correct, we *did* cure the $conditions problem, without enforcing everyone to add at least 4 lines of code.

EFQ got a lot easier to use since this got in, that's true, but we also have 54 calls to this function that would have to be updated and inlined.

fubhy’s picture

This does use EFQ internally, so the problem that $conditions had (not being able to cache it properly), is solved. So the issue summary is not correct, we *did* cure the $conditions problem,

Granted. It's still yet another procedural wrapper. We should stop with adding those at some point.

fubhy’s picture

Issue summary: View changes

Updated issue summary.

Mile23’s picture

Issue summary: View changes
Status: Needs review » Needs work

entity_load_multiple_by_properties() is marked deprecated for removal before Drupal 9, and EntityStorageController is a handler now: https://www.drupal.org/node/2200867

EntityStorageInterface::loadByProperties() exists and is not deprecated.

cilefen’s picture

Title: Nuke entity_load_multiple_by_properties() and EntityStorageController::loadByProperties() » Remove usages of entity_load_multiple_by_properties() and EntityStorageController::loadByProperties()

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.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.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.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.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.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.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.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.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.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.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.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.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.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.

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

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should 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.

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

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
aiphes’s picture

I encounter an issue to update my code using this function. Someone could help me ?
https://drupal.stackexchange.com/questions/309417/render-custom-region-i...

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

dimitriskr’s picture

Status: Needs work » Closed (outdated)

Quick search of these two functions on latest 11.x returned no results. If it's still an issue, please re-open it with the findings