Closed (fixed)
Project:
Redirect
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
26 Apr 2019 at 23:01 UTC
Updated:
2 Jan 2020 at 14:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sergiu stici commentedComment #3
sinn commentedComment #4
sinn commentedComment #5
sinn commentedAll deprecations are in one place. Including deprecations from D8.7.
Comment #6
berdirI'd rather use \Drupal::database()
Incorrect indentation, should start on the same level as before, I'd also prefer to keep it on a single level, easier to see what changed.
this conflicts with a patch that I just committed, that used Term::load()/Vocabulary::load(), which is fine too, so these parts should be removed from the patch.
Didn't spot any 8.7 specific deprecations, on the next reroll, please run a test with 8.7 and 8.6, so we can see if it fails on 8.6. If that's the case, then committing this needs to be postponed to when 8.6 is no longer supported.
Comment #7
berdirThe messenger changes have been separately committed as well now, so that's another thing that can be removed in the reroll.
Comment #8
berdirWe could maybe also keep this as a meta issue and do separate issues for the patches.. there will likely be more deprecations before D9 is out. There was one for db functions that I closed as a duplicate, we could reopen that or create a new one. Still not quite sure how to handle these issues.
Comment #9
karan_mudi commentedAttached patch for above issues.
Comment #10
karan_mudi commentedComment #11
karan_mudi commentedComment #12
karan_mudi commentedComment #13
dieterholvoet commented- fixed the indentation on the addMessage call
- removed the xdebug_break call
Comment #14
berdirComment #15
berdirThese changes are unrelated, the messenger conversion already happened and we shouldn't make unrelated coding standard changes here.
this too is an unnecessary change, the existing code is fine.
Same, one can argue over better DI, but the calls here for Term:: and Vocabulary:: are not deprecated and don't need to be changed anymore.
same.
missing a toString()
here too.
the order arguments between assertEqual() and assertEquals() changes, the expected value should be first. Also I think there might be an existing issue for this, if that is correct then lets remove these changes here, it's not strictly required for D9 anyway.
When picking up large patches, it's really important to provide interdiffs, so that it's possible to see what exactly has changed.
Comment #16
berdirAlso, running drupal-check with the patch applied gives:
The remaining simpletest should be ignored here, there is a separate issue and it's really hard.
But something is strange with the unit test base class, and there's also a time limit call to fix.
And we should include the core_version_requirement key, see https://www.drupal.org/node/3070687. Lets require ^8.7.7 || ^9. And make sure to to it in all info.yml files in the project. In turn, you can remove the drupal:system dependency.
Comment #17
berdirAlso, there are still quite a few entityManager references, that needs to be updated too.
Comment #18
gmangones commentedHi, Running drupal-check with the patch and applying the suggested.
Now display the following.
Thank's
Comment #19
berdirThat interdiff seems to be identical to the full patch.
this is not correct, $options doesn't do anything. This should not be changed here, it is deprecated by drush, not by Drupal core. And the whole file is for Drush 8 and needs to use Drush 8 API.
Still has unrelated messenger changes. No need to change these lines here.
Should be ^8.7.7 as I wrote. Users should update to the the latest 8.7 version, but 8.7.7 is the lowest-supported version that we can specify, so lets use that.
this is not correct, should use the entity_field.manager service.
also wrong change.
Also wrong, this is still a web test, and converting it is complicated and shouldn't be done here.
All changes in this file except the SafeMarkup should be reverted.
wrong change, was somehow merged with an old version.
unecessary.
still missing a toString()
And yes, the migrate test is also string wrong, which breaks tests completely.
Comment #20
berdirI think it might be easier to start from scratch as there's probably more wrong/unnecessary in this patch than right at this point.
Also, it might make sense to split up another issue with the easy conversions like db_query(), SafeMarkup and url changes. leaving the hairy ones for later, where we can focus on them.
Comment #21
gmangones commentedI started again from comment #13. Applied this patch and applied some changes only about ```drupal_set_time_limit function``` deprecated ```Drupal\simpletest\WebTestBase```.
Fix interdiff as well.
Need work about:
Thank's
Comment #22
berdirSee my review in #15, plenty of things aren't correct in #13 either.
Comment #23
gmangones commentedHi @Berdir,
Thank you for your corrections. So, Following your suggestions, I left it as it was and re-created the patch again with a new additions fixing the errors displayed after to run drupal-check command.
Thanks
Comment #24
berdirThanks, this is looking much better, now we're moving into the right direction.
clearCachedFieldDefinitions() and getFieldStorageDefinitions() needs to be called on entity_field.manager.
Another one to undo.
This is a really hard test to convert with a dedicated issue, the only change in here should be the SafeMarkup change.
Changes to this file can also be completely reverted, we also updated that to not use SafeMarkup at all in another issue.
The use statements need to be kept.
Maybe we should just compare the message and the unserialized array directly instead of passing it to FormatableMarkup? With two separate assertEquals comparisons.
the new use seems wrong, that's why tests are failing so hard.
The new base class is a kernel test. That means we need to move this to the src/Kernel folder and update the namespace (and fix the use).
Comment #25
berdirComment #26
berdirDid that cleanup.
6. Did that change and realized the the logging was actually logging the message with replaced placeholders, so the assertion only worked because the result was the same. That's bad for translatability, fixed.
7. I'm pretty confused about those migrate tests, I'm not sure what this is exactly testing and why there's more than test class for D7 that seems to be testing the same thing.
Comment #27
quietone commentedReview the migrate changes here and all of it looks good to me. There is one small nit about the array key names in the unit test. In core they are as shown below and I am just used to them. Change if you think it is worth the time.
Usually instead of $tests[0][0] it is $tests[0]['source_data']
And there it is $tests[0]['expected_data']
Comment #28
berdirThanks, addressed that and also a lot of additional deprecations that drupal-check doesn't find. Constants, injections, service calls.
The only thing left are 8.8 path alias deprecations, the hooks, PathAliasManager and a route in a test. Might be possible to address that while remaining 8.7 compatible but will consider that
Comment #31
berdirComment #33
berdirCommitted.
Comment #34
gmangones commentedGreat, thanks @Berdir.
Comment #35
mondrakeHi
is there as issue for that already?
Comment #36
berdirNo
Comment #37
mondrakeOK, filed #3102143: Remove Drupal 8.8 deprecations, compatibility with Drupal 9 so to track that for following up in dependent projects