Problem/Motivation
Drupal\Tests\BrowserTestBase::$defaultTheme is required in drupal:9.0.0 when using an install profile that does not set a default theme. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.
Proposed resolution
Some of the submodules' tests are broken right now. Fix this deprecation warning and coding standards can not bring back them to green.
So let's only fix those submodules which only have these deprecation warnings and coding standards issues.
As examples are small/tiny modules, I think it's ok to fix other tests/issues and this tiny issue at the same. Let the submodules untouched by the patch of this issue to fix its own deprecation warning later.
So this issue is targeting to fix this warning and coding standards of those corresponding submodules.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 3103518-13.patch | 2.56 KB | jungle |
Comments
Comment #2
jungleComment #3
jungleComment #4
valthebaldwhy disable phpcs?
Comment #5
jungleHi @valthebald. If do not disable it. phpcs would complain:
Yes, it's a useless method overriding. But the comment inside should be there. Disable it or remove the comment.
Comment #7
marvil07 commented@jungle: thanks for the patch here.
@valthebald: Hi! Nice to meet another maintainer.
On the phpcs warning, I guess it is OK to have that warning given the idea is to point to where to add the code.
Currently the provided patch seems to not apply anymore, so moving to NW.
I started with the examples module code, which seems to not yet be covered on the patch, and added that commit directly.
I needed to change a bit the logic on how the links were generated, so it is clear we are testing for something we know we are adding.
I see the patch is adding one
protected $defaultTheme = 'classy';, but I guess we should instead try to change the behavior to not rely on classy output, but I see all the rest is adding stark theme which is great.Comment #8
jungleYes, protected $defaultTheme = 'classy' should not be used, I was in a hurry to get all test cases passed while working on #3103586: [Meta] Bring back all tests GREEN, changing it to stark breaking existed tests I remember, so just kept it as classy for quick.
@marvil07 thanks for reviewing.
Re-rolled patch from #2
Comment #9
jungleComment #10
marvil07 commented@jungle: Thanks for the new iteration here.
Indeed it now applies, but I think most of the changes here are no longer relevant.
Several of them are adding
protected $defaultTheme = 'stark';to different classes that already have them.I am guessing that was not the case when this ticket was opened, as the first attached patch suggests.
For instance, just to point one example:
See the already defined data member <? $defaultTheme ?> before the lines added.
I also see several of the target deprecation messages triggered on the last branch test run.
Hence, I am moving this ticket back to NW.
@jungle: I will be taking a look at related issues, so this may be fixed as part of other test fixes; feel free to mark this as postponed if you think it is better to wait for the rest to get in.
Comment #11
jungleOoops, sorry, @marvil07, yes, you are right! I should check it in details myself. I think it is ok to close this issue now, nothing to do to meet the scope as the title indicated, right?
Comment #12
jungleSorry again, from the latest test run, https://www.drupal.org/pift-ci-job/1597488, yes, it still needs work and I will work on it.
Comment #13
jungleComment #15
jungleChecked https://www.drupal.org/pift-ci-job/1597504, no more $defaultTheme relevant notices.
Comment #16
govind.maloo commented#13 Patch is clean and able to apply. No more error related to the default theme.
Comment #17
valthebaldComment #19
valthebaldCommitted to 8.x-1.x, thank you!