Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Active » Needs review
FileSize
14.81 KB

There's one instance where I'm not sure what it is, see @todo.

Also weird, the storage uses this constant only internally (except field stuff), but EFQ uses it publicly, with a different meaning (load the revision vs query all the revisions). I think it would be better to create separate constants here.

Status: Needs review » Needs work

The last submitted patch, load-constants-2079011-1.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
1.68 KB
15.48 KB

Missed two instances too aggressive with deleting...

Berdir’s picture

Issue tags: +API change

Tagging.

Status: Needs review » Needs work

The last submitted patch, load-constants-2079011-3.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
4.4 KB
19.81 KB

More costant fixes.

Berdir’s picture

Title: Moved field.module constants related to storage to EntityStorageControllerInterface » Move field.module constants related to storage to EntityStorageControllerInterface
alexpott’s picture

+++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
@@ -202,6 +202,7 @@ public function query($use_groupby = FALSE) {
+      // @todo: What is this?
       $rkey = $this->definition['is revision'] ? 'FIELD_LOAD_REVISION' : 'FIELD_LOAD_CURRENT';

We can just use the constants properly here

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Looks good now.

Status: Reviewed & tested by the community » Needs work
Issue tags: -API change

The last submitted patch, load-constants-2079011-8.patch, failed testing.

alexpott’s picture

Status: Needs work » Needs review
Issue tags: +API change

#8: load-constants-2079011-8.patch queued for re-testing.

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Looks still ok :)

yched’s picture

Thanks folks ! I'm fine with this getting in to clean obvious scope issues, but I opened #2081513: Deprecate FIELD_LOAD_* constants for more thoughts on those constants.

+++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
@@ -202,7 +203,7 @@ public function query($use_groupby = FALSE) {
       $fields = array();
-      $rkey = $this->definition['is revision'] ? 'FIELD_LOAD_REVISION' : 'FIELD_LOAD_CURRENT';
+      $rkey = $this->definition['is revision'] ? EntityStorageControllerInterface::FIELD_LOAD_REVISION : EntityStorageControllerInterface::FIELD_LOAD_CURRENT;
       // Go through the list and determine the actual column name from field api.

Side note: this code looks wrong / broken anyway, see #2081533: Views "group by" on "Field API" fields broken

alexpott’s picture

Patch no longer applies :) rerolled - I'm all for getting this is and then working out if we can do without them

The interdiff was empty :) so attaching diff that shows a line that's unchanged by this patch has been changed.

catch’s picture

Priority: Normal » Critical
Status: Reviewed & tested by the community » Active
Issue tags: +Needs change record

Committed/pushed to 8.x, thanks!

Needs a change notice.

jibran’s picture

Title: Move field.module constants related to storage to EntityStorageControllerInterface » Change notice: Move field.module constants related to storage to EntityStorageControllerInterface
Issue tags: +Approved API change
alexpott’s picture

Title: Change notice: Move field.module constants related to storage to EntityStorageControllerInterface » Move field.module constants related to storage to EntityStorageControllerInterface
Priority: Critical » Normal
Status: Active » Fixed

Change notice created: https://drupal.org/node/2082357

Status: Fixed » Closed (fixed)

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

xjm’s picture

Issue tags: -Needs change record

Untagging. Please remove the tag when the change notification task is completed.