Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Status: Active » Needs review
Issue tags: +Needs tests
FileSize
556 bytes

Patch - needs tests, but not sure where they should be added yet.

yched’s picture

This is a smoketest patch that just removes the behavior, in the hope that the failing tests will point me to which test curently test this :-)

Status: Needs review » Needs work

The last submitted patch, 2: 2382493-translation_default_values-not-for-review-3.patch, failed testing.

yched’s picture

With tests.

To test the fact that we don't hardcode logic on the 'value' property, this switches the existing entity_test_field_default_value() callback, targetting it for the "shape" test field type.

The existing EntityTestDefaultValue, that also uses that callback, is changed accordingly - this also tests that "multiple items" default values work as expected, which was apparently not tested so far.

yched’s picture

Status: Needs work » Needs review

The last submitted patch, 4: 2382493-translation_default_values-5-test-only.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: 2382493-translation_default_values-5.patch, failed testing.

yched’s picture

Hm - that means moving the ShapeItem field type over to entity_test, though.

yched’s picture

Status: Needs work » Needs review
yched’s picture

Now that we're green, reuploading patch & test-only patch.
Note that the actual fix (see fix-only.patch) is a one liner, the rest is about making this testable.

The last submitted patch, 10: 2382493-translation_default_values-10-test-only.patch, failed testing.

plach’s picture

+++ b/core/modules/system/src/Tests/Entity/EntityTranslationTest.php
@@ -16,7 +16,9 @@
+  class EntityTranslationTest extends EntityLanguageTestBase {

Looks good, I have found just this wrong indentation :)

yched’s picture

Oops, indeed.
Also, reverted the addition of field_test.module to EntityFieldDefaultValueTest / EntityTranslationTest, not needed anymore.

yched’s picture

RTBC anyone ?

plach’s picture

Status: Needs review » Reviewed & tested by the community

Me :)

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 1290d38 and pushed to 8.0.x. Thanks!

  • alexpott committed 1290d38 on 8.0.x
    Issue #2382493 by yched: Population of default field values in entity...

Status: Fixed » Closed (fixed)

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