Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
https://www.drupal.org/pift-ci-job/31459:
fail: [Other] Line 130 of core/modules/node/src/Tests/Migrate/d7/MigrateNodeTest.php:
Value '1' is identical to value '1.0'.
New since yesterday. Was introduced in this commit:
commit 10ea52eaa23284ef213523483435ffe65eef12cd
Author: webchick <drupal@webchick.net>
Date: Wed Sep 9 15:09:01 2015 -0700
Issue #2563819 by phenaproxima, mikeryan: [D7] Field display settings do not migrate
So if this isn't a really quick fix, we can always roll back #2563819: [D7] Field display settings do not migrate (though that is a "Migrate critical" so it would be nice to avoid it.)
Here's the test:
/**
* Test node migration from Drupal 7 to 8.
*/
public function testNode() {
$this->assertEntity(1, 'test_content_type', 'en', 'A Node', '2', TRUE, '1421727515', '1441032132', TRUE, FALSE);
$this->assertRevision(1, 'A Node', '2', NULL, '1441032132');
$node = Node::load(1);
$this->assertTrue($node->field_boolean->value);
$this->assertIdentical('99-99-99-99', $node->field_phone->value);
$this->assertIdentical('1', $node->field_float->value); # Line 130.
$this->assertIdentical('5', $node->field_integer->value);
$this->assertIdentical('Some more text', $node->field_text_list[0]->value);
$this->assertIdentical('7', $node->field_integer_list[0]->value);
$this->assertIdentical('qwerty', $node->field_text->value);
}
Comment | File | Size | Author |
---|---|---|---|
#3 | 2566723.patch | 827 bytes | amateescu |
Comments
Comment #2
chx CreditAttribution: chx commentedThat issue is not Migrate critical but a Migrate D7 critical (this is why I insisted on splitting the tags!) which is not even a Drupal 8.1.0 target necessarily compared to this which is a Drupal 8.0.0 RC1 target. Let's roll it back and then figure it out over there.
Comment #3
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedYeah, SQLite is very sensitive with floats. This would be the easy fix.
Comment #4
webchickWonder if we should invert that and do assertIdentical on 1.0. Weird that this passes MySQL, even. You'd think a float would be a float.
Comment #5
dawehnerI think, its exactly what we test. Its the fact that PgSql actually understands what a float is.
Comment #6
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedMySQL (and most likely Postgres too) are trimming trailing zeros by default, so we would need to use
FORMAT()
on the float value at select-time if we want the output to be1.0
on all database drivers.Comment #7
quietone CreditAttribution: quietone commentedSome time ago in Convert assetEqual to assertIdentical in migrate_drupal it was agreed to use assertIdentical in all cases for migration. If there is no other solution possible please add a comment to state why assertEqual is being used instead of assertIdentical in this instance.
Comment #8
dawehnerWell, in order to know we would need to know the schema of our database tables at runtime, which is a total different new wormhole.
Comment #9
webchickYeah, let's just do the simplest thing that can possibly work here. Thanks a lot for the fast turnaround, amateescu!
Per quietone, commented that line with:
Committed and pushed to 8.0.x. Thanks!
Comment #11
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedIf we really want to keep the
assertIdentical()
check, we could do it like this. Basically, as pointed out in http://stackoverflow.com/a/7466548/1499564, this is just a rendering issue.Edit: cross-post with #9 :)
Comment #12
webchickThat seems a lot less readable. :) We'll see what the migrate team has to say when they wake up in a few hours.
Comment #13
mikeryanYes, the assertEqual is clearer, let's leave it be.
Thanks for getting that fixed quickly!
Comment #14
chx CreditAttribution: chx commentedI agree with #7
Comment #15
webchickThat was done already. See #9 / http://cgit.drupalcode.org/drupal/commit/?id=bcf90b1.
Comment #16
chx CreditAttribution: chx commentedThanks!