drush icon indicating copy to clipboard operation
drush copied to clipboard

Add a command to rebuild all display- and form-modes

Open ndf opened this issue 4 years ago • 7 comments

This is a command that let you recreate all display- and form-modes with $ drush entity:rebuild-display-config.

In https://www.drupal.org/project/drupal/issues/2915036 we introduces a functionality that fires on field_insert on a per entity_type and bundle bases. This command does the same but then for all entity_types and bundles.

There is no regression or misconfiguration issue. The command fixes possible misconfigurations.

ndf avatar Feb 22 '21 16:02 ndf

Ok cool the PR is here :) Now it won't be lost. Please give me some time to doublecheck everything.

ndf avatar Feb 22 '21 16:02 ndf

Thanks. Some quick notes:

  • Any error handling needed?
  • A preview of what updates will be confirmed before confirmation
  • Can this move to src/Drupal/commands. Then it won't need @bootstrap full since all commands there are full.
  • Testing
  • "Rebuild display configuration" should be "form and display configuration"

weitzman avatar Feb 22 '21 16:02 weitzman

Still work-in-progress; A confirmation and preview of what entity-types and bundles will be processed is done YAY

ndf avatar Mar 19 '21 14:03 ndf

| Can this move to src/Drupal/commands. Then it won't need @bootstrap full since all commands there are full. That's done too

ndf avatar Mar 22 '21 12:03 ndf

@weitzman I think all the needs-work things are fixed. The ticket was locked quit a while, because of an unrelated build-check failure. Would be awesome if this issue could be merged :)

ndf avatar Nov 03 '21 10:11 ndf

I changed target branch to 11.x. There is some unrelated changes showing in the PR. I'm still undecided about this in Drush core. When would users need to run this?

weitzman avatar Nov 05 '21 03:11 weitzman

Sorry I missed your reply. Just now it's rebased to the 11.x branch.

I'm still undecided about this in Drush core. When would users need to run this? The command is useful for sites where the exported config of display is different than the actual (in database stored) config. What I have seen a lot, is that when a field is added to a bundle and then the config is exported, the actual export contains many more (unrelated) changes. This happens if a display is not re-saved every time the dependencies of the display changes. The goal of this new command is mostly to get cleaner config-exports.

ndf avatar Dec 03 '21 14:12 ndf