Problem/Motivation

As per #2289391-17: Reconsider whether FieldDefinition should implement FieldStorageDefinitionInterface

We should rename FieldDefinition (the implementation class, not the interface) to BaseFieldDefinition, since it's an implementation specific to base fields.

Sandbox sandbox/yched/1736366.git/2315237-fd2bfd branch

Proposed resolution

Run rename in PHPStorm.

Remaining tasks

Commit.

Comments

xjm’s picture

It seems like this should maybe be a beta deadline. What would the implications be of changing this between beta1 and beta2? (What changes would contrib code have to make, if any?)

yched’s picture

Issue tags: -beta target +beta deadline

@xjm: right

yched’s picture

Also, er - I won't be able to code for the next 10-ish days, so... any takers ? :-)

AFAICT, this shouldn't be much more than a class rename in PHPstorm (yeah, famous last words...)

andypost’s picture

Status: Active » Needs review
StatusFileSize
new90.02 KB

let's see how phpStrom rename works...
PS: pushed to sandbox/yched/1736366.git/2315237-fd2bfd branch

Status: Needs review » Needs work

The last submitted patch, 4: 2315237-fd2bfd-4.patch, failed testing.

Status: Needs work » Needs review

andypost queued 4: 2315237-fd2bfd-4.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 4: 2315237-fd2bfd-4.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new90.91 KB

Missed file rename in previous patch

Status: Needs review » Needs work

The last submitted patch, 8: 2315237-fd2bfd-8.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new4.62 KB
new94.86 KB

should fix most of failures
also renamed FieldDefinitionTest.php => BaseFieldDefinitionTest.php according class rename

Status: Needs review » Needs work

The last submitted patch, 10: 2315237-fd2bfd-10.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new94.92 KB

merge HEAD

andypost’s picture

StatusFileSize
new94.97 KB

re-roll

codekarate’s picture

Issue tags: +TCDrupal 2014

At TCDrupal Sprint, going to review this patch!

codekarate’s picture

Was not able to fully review this, but grep did turn up a few possible missed changes.

./core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php: $id_definition = $this->getMockBuilder('Drupal\Core\Field\FieldDefinition')
./core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php: $bundle_definition = $this->getMockBuilder('Drupal\Core\Field\FieldDefinition')
./core/lib/Drupal/Core/Field/FieldItemInterface.php: * @see \Drupal\Core\Field\FieldDefinition
./core/lib/Drupal/Core/Field/FieldItemInterface.php: * @see \Drupal\Core\Field\FieldDefinition

Even after these changes, this patch will still require some additional review.

andypost’s picture

Issue summary: View changes
StatusFileSize
new2.71 KB
new96.86 KB

HEAD is moving, fixed #15

codekarate’s picture

Status: Needs review » Reviewed & tested by the community

This all looks good to me. All instances of FieldDefinition have been changed to BaseFieldDefinition, all tests pass, and everything else seems to check out.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Should rename FieldDefinitionTestBase to BaseFieldDefinitionTestBase since this can only test BaseFieldDefinition's

xjm’s picture

Issue tags: +Novice

Renaming the test base class is probably a good, straightforward new contributor task.

daggerhart’s picture

I'm going to give this a shot.

daggerhart’s picture

StatusFileSize
new1.49 KB
new141.38 KB

I attempted to rename FieldDefinitionTestBase to BaseFieldDefinitionTestBase according to #18. Attached is interdiff and full patch.

daggerhart’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 21: 2315237-fd2bfd-21.patch, failed testing.

daggerhart’s picture

Status: Needs work » Needs review
StatusFileSize
new5.19 KB
new145.06 KB

Another attempt to rename FieldDefinitionTestBase to BaseFieldDefinitionTestBase according to #18. Attached is interdiff and full patch.

andypost’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.12 KB
new97.81 KB

merged HEAD, fixed comment for base test class + #21 +#24

@daggerhart to reduce the patch size with git config:

[diff]
  renames = copies

More info is here: https://www.drupal.org/documentation/git/configure

chrischinchilla’s picture

Updating issue summary at TC Drupal camp… In progress…

chrischinchilla’s picture

chrischinchilla’s picture

Issue summary: View changes
alexpott’s picture

Issue summary: View changes

Updated issue summary since #25 rolled the patch with the correct git config.

Note this patch conflicts majorly with #2283977: Create a new ConfigEntity type for storing bundle-specific customizations of base fields

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 8fe8142 and pushed to 8.0.x. Thanks!

  • alexpott committed 8fe8142 on 8.0.x
    Issue #2315237 by andypost, daggerhart | yched: Rename FieldDefinition...
alexpott’s picture

yched’s picture

Yay! Thanks @andypost!

Status: Fixed » Closed (fixed)

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

jibran’s picture