Problem/Motivation
This module needs to be prepared for Drupal 9. This involves fixing all deprecated code references and setting the core_version_requirement key in the datalayer.info.yml file (see: https://www.drupal.org/node/3070687)
Proposed resolution
- Fix any deprecated code references
Remaining tasks
TBD
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
Drupal 9 readiness
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | Drupal_9_Readiness-3108690-4-plus-test-again.patch | 3.64 KB | WidgetsBurritos |
| #17 | 3108690-D9-readiness-11-again.patch | 3.46 KB | WidgetsBurritos |
Comments
Comment #2
WidgetsBurritos commentedThis is a good candidate for Drupal Global Contribution Weekend 2020
Comment #3
rksyraviComment #4
rksyraviHi,
Below patch will help in resoling drupal 9 readiness.
Comment #5
WidgetsBurritos commentedThis won't work because $this->requestStack has not been defined in this object. It would need to be injected via the __construct() and create() methods.
These whitespace changes aren't necessary and actually introduce new coding style failures. See https://www.drupal.org/pift-ci-job/1554143
Comment #6
uberhacker commentedWorking on this for Austin Global Sprint Weekend.
Comment #7
uberhacker commentedRemoved `empty($_POST)` check in src/Form/DatalayerSettingsForm.php.
Comment #8
uberhacker commentedComment #9
rksyraviHi @WidgetsBurritos,
Reference to comment
1.
This won't work because $this->requestStack has not been defined in this object. It would need to be injected via the __construct() and create() methods.*** I understand that
$this->requestStackis not defined in the current class but it is available in the parent class.class DatalayerSettingsForm extends ConfigFormBase>>abstract class ConfigFormBase extends FormBase>> in this classprotected $requestStack;is used. Check this path for your confirmation/web/core/lib/Drupal/Core/Form/FormBase.phpfile.2. Whitespace changes aren't necessary and actually introduce new coding style failures.
*** These are just part of the code formatting and drupal coding standards.
Comment #10
rksyraviHi @uberhacker,
Removed `empty($_POST)` check in src/Form/DatalayerSettingsForm.php b/src/Form/DatalayerSettingsForm.php.*** Simply removing the variable is not an option, if the dev has used and check for empty then there must be some need according to his requirement.
Comment #11
WidgetsBurritos commentedI've included a patch that adds a test to @uberhacker's patch.
@rksyravi,
I'm attaching a test that proves that this is not actually getting instantiated as it generates this error:
If you view the link I posted, you'll see that this is actually introducing 2 new coding standard problems, so no we don't want this.
As a maintainer of this module, I've worked with @uberhacker separately, along with a few other people at our meetup to determine that is not actually needed based on the context of what is there. So we've decided just removing it is the best course of action.
Comment #12
WidgetsBurritos commentedWell no I didn't attach the new patch on that previous comment. Let's try that again.
Comment #14
WidgetsBurritos commentedAdding credit for cutehair from the Austin Contribution Weekend meetup discussion
Comment #16
WidgetsBurritos commentedAdding credit for rocketeerbkw from the Austin Contribution Weekend meetup discussion
Comment #17
WidgetsBurritos commentedSomehow those patches got corrupted. Trying this again.
Comment #18
rocketeerbkw commentedLGTM!
Comment #20
WidgetsBurritos commentedComment #21
WidgetsBurritos commentedBased on the (very limited) test coverage, D9 should work based on the current deprecations. Obviously D9 is still a moving target, and may change but we appear to have coverage for now: