Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291271

Get rid of FIELD_LOAD_* constants ?

$
0
0

- Those constants are used for "field loading" logic. This used to be part of a public API (field_attach_load() & friend), but this logic is now internal to the storage controllers, and there is no external facing API for those operations.
So the storage controllers using those constants is fine, but external code referring to them feels like messing with something you're not supposed to know.

- Even within storage controllers: the rest of the entity loading code rather uses a boolean $load_revision flag, and "translates" it to one of the constants when doing "field stuff":

protected function attachLoad(&$queried_entities, $load_revision = FALSE) {
  $this->loadFieldItems($queried_entities, $load_revision ? FIELD_LOAD_REVISION : FIELD_LOAD_CURRENT);

Looks like two different systems talking to each other - which *was* the case, but is now a bit absurd within one single class / class hierarchy.


Viewing all articles
Browse latest Browse all 291271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>