Problem/Motivation
To get around all the UX issues identified in #3431164: [meta] Improve the "Expose all fields as blocks to Layout Builder" feature with this configuration page, we can instead use a Feature Flag #3423352: Add an API for feature flags
This configuration is essentially being used as a feature flag currently, but does not need to be. The behaviour when this configuration is enabled is only there for BC purposes, it is not recommended for new sites to enable it. Therefore, we shouldn't be using configuration as this will lead to issues in the future when we need/want to deprecate/remove this behaviour.
Feature flags allow us to do this gracefully, and get around all of the issues with exposing this behaviour via configuration.
Proposed resolution
Remove configuration and form
Remove settings form tests
Swap configuration check with a moduleExists
Remaining tasks
User interface changes
Remove Layout builder Settings form.
API changes
None
Data model changes
None
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | 3432874-drupal-ignore-expose_all_field_blocks-install-22.patch | 811 bytes | codebymikey |
Issue fork drupal-3432874
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:
- 3432874-replace-expose-all
changes, plain diff MR !7142
Comments
Comment #3
acbramley commentedComment #4
catchThis is a very good idea and the diffstat also shows how much it simplifies things compared to using custom config. I think we should go ahead here, and whether or not we use feature flags for many other things can be figured out in #3423352: Add an API for feature flags.
We should have a follow-up to deprecate the module too.
Comment #5
smustgrave commentedSo moving the settings to flags how would that work for configuration exports and schema validation? Would flags be exportable?
Change looks neat and can think of a few other tickets that could use this. Probably need to get in before 10.3 to avoid having to do a update hook to remove the config.
Comment #6
catch@smustgrave in this case the flag is just whether a module is enabled or not - so it's all controlled by the extension config object with no new infrastructure.
Couple of questions on the MR.
Comment #7
wim leers+1 for more "zero config", which indeed requires more tightly focused modules to be installed. (A very similar example is how https://www.drupal.org/project/big_pipe_sessionless is a contrib module with zero settings that upon installation provides one very specific feature on top of core's
big_pipemodule. That is very similar to the structure/approach what's being proposed here.)Comment #8
smustgrave commentedSeems to cause a few test failures.
Comment #9
aaronmchaleJust reporting the comment I just made on the parent issue because it's equally relevant here:
Comment #10
acbramley commentedFixed the legacy tags and it's back to green.
Comment #11
smustgrave commentedFeedback appears to be addressed.
Comment #12
alexpottI don't see how this can be rtbc until #3423352: Add an API for feature flags has been agreed. I'm +1 on the approach but there are still outstanding questions on the parent issue.
Comment #13
catchI personally think we should go ahead here, and then if we add a new package, extensions page filter etc. in the other issue (or spin-offs from that issue), the module added here can be brought up to date with those when they happen.
If we don't do this before 10.3.0, we have config to deprecate/remove in updates etc. to worry about.
Comment #14
alexpott@catch has convinced me that doing this now and before 10.3 is in our interest due to update functions. We can update the module's package etc later.
Comment #15
catchGave this another once-over.
I agree we'll probably need to change this once #3423352: Add an API for feature flags is resolved, but it'll be much easier to tweak the package and maybe hook_help() etc. than it will to make this change once the existing config has made it into a tagged release - we're saving ourselves 2-3 update hooks if we do it in this order as well as introducing then removing translatable strings etc.
Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!
Comment #18
catchComment #19
acbramley commentedAmazing! Thanks guys
Comment #22
luke.leberTemp patch for 10.3.x that prevents a silly
1. Site is slow
2. Site is fast (after code deployed, before updb runs)
3. Site is slow (after updb runs, before config imports)
4. Site is fast (after config import turns the module back off
deployment strategy 🤭.
Intended use is to patch only during the 10.3 upgrade then remove. This can be helpful for users that consistently see database deadlock problems arising from huge block plugin cache writes...
Comment #23
quietone commentedChanging to needs work and tagging because the related documentation updates have not been made. This change added a lifecycle link,
lifecycle_link: "https://www.drupal.org/node/3223395#s-layout-builder-expose-all-field-blocks", but there is no information on the page for what to do if you are using the feature.Comment #24
bkosborneWith this feature module disabled, I'm seeing log messages like this when enabling layout builder on an entity view display of any entity type (tried both node and taxonomy)
It's just a warning and things are fine (probably after block plugin caches get invalidated somewhere).
It's from BlockManager being unable to find the block plugin definition. I suppose there's some cache race condition here contributing to this. When you enable layout builder for an entity view display, it creates the default layout view display and places a field block plugin for each field. But since we're not exposing field block plugins until the entity view display is converted to layout builder.... yeah.
Comment #25
bkosborneCreated #3478773: Warnings logged for missing field block plugins when enabling layout builder on an entity view display for the first time
Comment #26
acbramley commentedThat's probably due to the fact that layout builder automatically (and blindly) adds fields to layouts even if the plugins don't exist. There's an issue for stopping that too
Comment #27
codebymikey commentedAttached a static copy of the proposed patch in #22 for those who need it.
Comment #28
quietone commentedAssigning to myself to check on the doc updates
Comment #29
quietone commentedI confirmed that the documentation update is complete. Therefor, I am restoring the fixed status of this issue.
Comment #30
quietone commentedComment #31
xjmAdding credit for @quietone for the documentation work, plus a couple reviewers who were missed. (They helped my understanding of the issue for reviewing the docs, anyway.)