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.
When running ctools test suite with php7 we get the following failure.
There was 1 failure:
1) Drupal\Tests\ctools\Unit\VariantCollectionTraitTest::testGetVariantsSort
Failed asserting that Array &0 (
'foo' => 'foo'
'bar' => 'bar'
) is identical to Array &0 (
'bar' => 'bar'
'foo' => 'foo'
).
Since the plugins created for the variant tests here don't have a weight, they get the "identical" sort behavior. This changed in PHP 7 to not swap the values though[ref]. I think the likely solution is to fall back on sorting by id when there isn't a weight so variants sort consistently in all versions of PHP and identical weighted variants have a logic order.
Comment | File | Size | Author |
---|---|---|---|
#2 | variant_sort_isn_t-2631342-2.patch | 536 bytes | neclimdul |
Comments
Comment #2
neclimdulPatch
Comment #3
neclimdulComment #5
neclimdulI think tim gave me the nod that this looked right in IRC so went ahead an pushed it :)