Closed (fixed)
Project:
Crop API
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Nov 2019 at 23:51 UTC
Updated:
31 Jan 2020 at 02:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jfussion commentedComment #3
milindk commentedOn 8.x-2.x branch: I can see following deprecations:
Comment #4
milindk commentedOn 8.x-1.x branch: I can see following deprecations:
After applying patch:
Comment #5
milindk commentedComment #6
milindk commentedFixed code changes and test cases for 8.x-1.x.
Comment #7
amitgoyal commented@milindk This issue is meant for 8.x-2.x-dev. I think we should fix deprecations in latest dev-x version if any.
I am not able to patch in #6 on latest 8.x-2.x-dev.
Comment #8
amitgoyal commented#3 looks good to me for 8.x-2.x-dev
Comment #9
effulgentsia commentedReuploading #3 for clarity. It looks like the correct fix to me. Even though system_get_info() didn't get deprecated until 8.8.0, ExtensionList::getExtensionInfo() has been around for a while, so I don't think this fix breaks 8.7.
Comment #10
chr.fritschThis should also be fixed:
Comment #11
andreyjan commentedAdded changes per #10 and also replaced usages of deprecated 'entity.manager' .
Comment #12
amitgoyal commented#11 looks good to me.
Comment #13
berdirThis is an entity form, which already has entityTypeManager injected through a setter method, so you can just use $this->entityTypeManager->getStorage where it is needed and skip the injection.
this should really use installEntityType, also the parent already does this for file anyway, so we can remove setUp() completely IMHO.
Also, lets update info.yml, add a core_version_requirement key instead of core: 8.x per https://www.drupal.org/node/3070687. And a drupal/core requirement to composer.json.
Comment #14
akashkumar07 commentedMade suggested changes. Please review.
Comment #15
berdirThanks, good improvements, still a chunk of things left to do.
drupal-check:
when running tests:
Mostly overlaps but not completely.
The crop_type problem has a dedicated issue: #3088355: crop_type config entity requires a config_export key since Drupal 8.7, so lets ignore the. Lets also ignore the few 8.8 only deprecations.
The other things can already be fixed.
Comment #16
phenaproximaApplied the patch in #14 to 8.x-1.x, then ran drupal-check and all tests locally. Nothing reported any errors. I think this is good to go. I'd like to commit it and roll a release; but I'd like to confirm with another maintainer before I do this.
Comment #17
phenaproximaAh wait, I missed the deprecation errors thrown by tests. Those are still present. Investigating more closely...
Comment #18
phenaproximaOkay, back to RTBC. I confirmed that 8.7.x deprecations do not get thrown by tests. This final patch changes the
core_version_requirementto the more precise'^8.7.7 || ^9'value, but other than that is identical to #14.Comment #19
phenaproximaAnd, back to RTBC. D'oh.
Comment #20
phenaproximaSigh.
Comment #21
phenaproximaOkay, back to RTBC now.
Comment #22
berdir+1, forget my previous comment, I was drunk or something. There is only one single 8.8+ deprecation left with this patch now against 8.x-2.x:
That will need to wait until we require 8.8.
Comment #24
phenaproximaCommitted and pushed to 8.x-2.x. Thanks!
Comment #25
effulgentsia commentedAwesome to see the 2.x branch fixed!
Is #22 an accurate comment? If I remove the crop.install hunk from #20 and apply the rest of that patch to 1.x, I still get 6 deprecation errors, but not the one related to uriScheme() mentioned in #22.
Not sure if we care about supporting 1.x on Drupal 9, so this question might not be relevant, but posting this comment in case anyone else stumbles on #22 and is confused by it.
Comment #26
berdirNo, I meant 8.x-2.x in #22.
The 1.x branch is for media_entity compatibility, which currently does intend to become D9 compatible. A lot of existing installs might still use that branch as they don't use media at all, so updating should be easy, now that is the stable and recommended version. media_entity usage has been going down slowly but steadily as well: https://www.drupal.org/project/usage/media_entity.
Comment #27
effulgentsia commentedOk, great! However, I don't see uriScheme() being called anywhere in the 2.x branch of CropFunctionalTest. Are you still seeing that error?
Comment #28
berdirThe call is here: https://git.drupalcode.org/project/crop/blob/8.x-2.x/crop.module#L189
Comment #29
effulgentsia commentedAh, yes, that highlights the limitation of PHPStan (or static analysis in general).
If you change:
to:
Then, PHPStan will flag it as a deprecation error. But the current top code block does not get flagged as an error in static analysis, so I guess only during runtime testing.
Comment #30
effulgentsia commentedI opened #3106988: Deprecated method invocations on non-type-hinted objects are not detected for #29.