Problem/Motivation

Drupal 8.8 deprecations are tricky because they will not be released before December, so people cannot fix them yet. However many of the 8.8 deprecations have replacements in previous versions, meaning they could be acted on now. @mixologic prepared a list which we can use to annotate deprecation messages and categorize them appropriately.

Proposed resolution

Annotate deprecation messages with this additional information in the module. This should make them end up in different categries beyween fix now and fix later.

Remaining tasks

Do it.

User interface changes

Deprecations will end up in more accurate categories based on availability of their replacement API.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy created an issue. See original summary.

Gábor Hojtsy’s picture

Assigned: Unassigned » Gábor Hojtsy
FileSize
9.4 KB

Attached file from @mixologic with extra info about deprecations.

  • Gábor Hojtsy committed ca344bf on 8.x-1.x
    Issue #3074833 by Gábor Hojtsy: prepare for fixing categorization of 8.8...
Gábor Hojtsy’s picture

Started with some minor refactoring to help with this ^^ :)

Berdir’s picture

> However many of the 8.8 deprecations have replacements in previous versions, meaning they could be acted on now.

Most of the things that I did used the actual core version where the replacement was initially added, even if the @trigger_error() only happened now. "Many" is a bit optimistic ;)

All the file_* stuff is new in 8.8 I think. Some functions were deprecated before, but we deprecated their replacement and moved them somewhere else now.

entity_get_display()/entity_get_form_display() is a special case, it was deprecated before but there was no useful replacement, which was only added in 8.8, which is why we bumped the version. You shouldn't update that on 8.7 or older, and I get a lot of issues/patches about that unfortunately.

Crypt functions are implicitly tied to 8.8 due to the PHP 7.0 version requirement, you could of course explicitly require PHP 7 in your module already and then replace calls to them. But not really worth it, it's a trivial 1:1 replacement anyway.

WebTestBase is obviously a candidate for this and so are a bunch of traits that were deprecated.

entityManager() related stuff is trickier than you'd think, the actual replacement existed since Drupal 8.0, sure, but those in the list refer to helper methods on traits and base classes that were really only added in 8.8. The old entity_* functions are safe, yes.

Gábor Hojtsy’s picture

Status: Active » Needs review
FileSize
2.73 KB

Thanks @berdir. Let's do WebTestBase and TestBase 8.8 deprecations then first, those sound safest. This would hopefully fail because I did not yet adjust the expected test results. It did not run properly locally, so running here while debugging local environment.

Gábor Hojtsy’s picture

FileSize
2.72 KB
597 bytes

LOL it helps to have valid PHP. Also of course the tests will not yet find this deprecation as it was literally introduced in 8.8 and we are not running yet our testbot tests against 8.8-dev. What I will do for now is to leave the test class there, which will start failing tests on 8.8 reminding us to add test coverage for it then. It could be better with some conditional test coverage based on which version we are running against, but I don't have capacity for that magic ATM.

Gábor Hojtsy’s picture

FileSize
2.83 KB
567 bytes

Testbot concerned with lack of @group annotation on the "test class" even though I put it on purpose in a different location so it does not interfere with real tests. Well.

Status: Needs review » Needs work

The last submitted patch, 9: 3074833-9.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Gábor Hojtsy’s picture

FileSize
2.93 KB
1.13 KB

One of the fails is a lack of test method, haha. Otherwise parenthesis problems in preg_match which locally did not seem to appear(?!$)

Gábor Hojtsy’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 11: 3074833-10.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Gábor Hojtsy’s picture

Status: Needs work » Needs review
FileSize
2.93 KB
645 bytes

Now down to the preg problems, the same preg does not have the same escaping problems locally. Let's try this double escaping.

  • Gábor Hojtsy committed a349873 on 8.x-1.x
    Issue #3074833 by Gábor Hojtsy, Mixologic, Berdir: Identify [Web]...
Gábor Hojtsy’s picture

I landed the [Web]TestBase stuff, but we can still improve this to add more items later. Keeping this open.

Gábor Hojtsy’s picture

Ported this temporary hack to deprecation_status so we get more realistic directions from that too. https://git.drupalcode.org/project/deprecation_status/commit/a292a0137db...

Gábor Hojtsy’s picture

Status: Needs review » Fixed

After further discussion with @berdir, this is probably as far as we can get here.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.