Support loading rules (and updating CSS) from saved configuration

Created on 1 September 2021, over 3 years ago
Updated 15 September 2023, over 1 year ago

Problem/Motivation

This is the real motivation for #3230827: Test fixes for 2.x โ†’ :)

The current situation is that the CSS is only written to disk when the config form is saved. This means that you can't use this module from an existing configuration, nor deploy changes to it via configuration import. (Or, you can - but it requires an additional save click in the admin form each time.)

My first approach was to preserve the built CSS to disk and pick up on that via config event listeners, but this turned out to be unreliable for some reason, and didn't seem worth the effort when we can build and output the CSS effectively as required.

So, MR!3 does that - it injects additional CSS inline into the node edit form, which delivers the same outcome and better supports config api operation.

Steps to reproduce

- Deploy changes to the module via `drush config:import`
- Observe that changes are not displayed to admin until admin form is also saved
- Note that files stored to sites/default/files/css *might* be cleaned up unexpectedly, breaking this module's behaviour until Save gets clicked again

Proposed resolution

- Generate CSS from stored config when called from form alter

Remaining tasks

- Review
- Merge

Happy to write test coverage for behaviour, but we need to turn tests on for the module and get existing tests passing ( #3230827: Test fixes for 2.x โ†’ ) and coding standards fixed first.

User interface changes

API changes

Data model changes

โœจ Feature request
Status

Fixed

Version

2.0

Component

User interface

Created by

๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand xurizaemon ลŒtepoti, Aotearoa ๐Ÿ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024