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.
Comment | File | Size | Author |
---|---|---|---|
#12 | 3001958-12.patch | 4.32 KB | Wim Leers |
#12 | interdiff.txt | 1.66 KB | Wim Leers |
#10 | 3001958-10.patch | 4.42 KB | Wim Leers |
#10 | interdiff.txt | 2.13 KB | Wim Leers |
#4 | 3001958-4.patch | 4.35 KB | Wim Leers |
Comments
Comment #2
Wim LeersTwo classes in JSON API use this trait:
\Drupal\Tests\jsonapi\Functional\InternalEntitiesTest
\Drupal\Tests\jsonapi\Functional\JsonApiFunctionalTestBase
For the first, we can just add
@requires function \Drupal\Tests\field\Traits\EntityReferenceTestTrait::createEntityReferenceField
. That means it won't run on Drupal 8.5 anymore, but the probability of that breaking is absolutely miniscule.For the second, I'd say we do the same, but …
class \Drupal\Tests\jsonapi_extras\Functional\JsonExtrasApiFunctionalTest extends JsonApiFunctionalTestBase
. IOW: we'd make it impossible for JSON API Extras to still run that test against Drupal 8.5. Plus,class class JsonApiFunctionalTest extends JsonApiFunctionalTestBase
is also pretty important, and frequently caught regressions before commit, so should still run on 8.5.Hence for that class, I'm just copy/pasting the contents of the trait into the base class.
Comment #4
Wim LeersWell that didn't work. Apparently my only option is duplicating that trait until we require Drupal 8.7.
Comment #5
Wim LeersComment #6
Mile23See: #3002011: Remove @trigger_error() for 8.6.x Drupal\field\Tests\EntityReference\EntityReferenceTestTrait deprecation
Comment #7
gabesulliceTesting it now.
Comment #8
Wim LeersComment #10
Wim LeersWell, now 8.6 passes tests, but 8.7 still doesn't. And I can't fix it on 8.7 without breaking it for 8.5. So … #3002011: Remove @trigger_error() for 8.6.x Drupal\field\Tests\EntityReference\EntityReferenceTestTrait deprecation did not actually help.
So, updating this patch so it passes CS testing.
Comment #11
gabesulliceWe have a "ForwardCompatibility" namespace. Can we have a "BackwardCompatibility" namespace for this?
Otherwise, this is RTBC.
Comment #12
Wim LeersExcellent idea!
Comment #14
Wim LeersComment #15
Wim LeersThis unblocked #3001564: Follow-up to #2997600: Clean up dead code paths and #2986900: Unnecessary asserts break installation in distros that include JSON API.
Comment #16
Wim LeersThis also triggered the creation of #3002148: Support deprecation testing for multiple branches on contributed modules on Drupal.org, which will help prevent this problem from occurring in the future.