Problem/Motivation

config value use_default_styles is always executed as TRUE, so the default CSS is always loaded

Steps to reproduce

Install Cookies module
- go to /admin/config/system/cookies/config
- uncheck checkbox Styling --> Use default styles
- save and clear cache
- check if browser stops loading file /libraries/cookiesjsr/dist/cookiesjsr.min.css

Proposed resolution

Fix getter of cookies.config.use-default_styles - see patch

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork cookies-3353972

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Jiskra created an issue. See original summary.

jiskra’s picture

anybody’s picture

Status: Active » Needs work

Thanks @Jiskra - could you please provide a MR instead of a patch and keep the dependency injection ($this->configFactory)?

J-Lee made their first commit to this issue’s fork.

j-lee’s picture

Version: 1.2.0 » 2.x-dev
Status: Needs work » Needs review

Opened the MR

anybody’s picture

Thank you @J-Lee! MR looks good, now we need someone to test it or even better add a simple test case for this to ensure it works in the future.

j-lee’s picture

Assigned: Unassigned » j-lee

Working on the tests

grevil’s picture

Status: Needs review » Needs work

Tests are failing.

j-lee’s picture

Status: Needs work » Needs review

I have problems with the local test environment and a chmod permission problem, so I will test here.

anybody’s picture

Off-topic: @Jiskra you may want to try https://github.com/webksde/ddev-vscode-devcontainer-drupal9-template
Batteries and testing included with just two commands ;)

grevil’s picture

Status: Needs review » Needs work

@Anybody, I think you meant @J-Lee?

Still one test fails, see https://git.drupalcode.org/issue/cookies-3353972/-/jobs/120727.

j-lee’s picture

Status: Needs work » Needs review

I think I fixed the new tests for the default stylesheet behavior.
As a followup, perhaps a test base class could be created to better organize the tests.

Sorry for the long wait but I had to fix my dev environment first. Thanks @Anybody for the link.

j-lee’s picture

Assigned: j-lee » Unassigned
grevil’s picture

Status: Needs review » Reviewed & tested by the community

Alright, just some small additions. LGTM!

  • Anybody committed 47555427 on 1.2.x authored by J-Lee
    Issue #3353972 by J-Lee, Grevil, Jiskra, Anybody: Use default style...
grevil’s picture

Status: Reviewed & tested by the community » Fixed

As a followup, perhaps a test base class could be created to better organize the tests

There is a test base class for functional js tests, btw! But yea, I agree, that one for normal functional tests could be beneficial!

anybody’s picture

Status: Fixed » Closed (fixed)

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