Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
- Install Standard.
drush cex -y
- Navigate to the config sync directory and initialize a git repository:
git init && git add . && git commit -am "Initial Standard install."
- Visit
/admin/structure/types/manage/article/display
and save the form without making any changes. - Visit
/admin/structure/types/manage/article/form-display
and save the form without making any changes. drush cex -y
- Do a
git diff
in the config sync folder. You will see:
diff --git a/sync/core.entity_form_display.node.article.default.yml b/sync/core.entity_form_display.node.article.default.yml index 6f17525..9d351cb 100644 --- a/sync/core.entity_form_display.node.article.default.yml +++ b/sync/core.entity_form_display.node.article.default.yml @@ -54,7 +54,10 @@ content: type: entity_reference_autocomplete_tags weight: 3 region: content - settings: { } + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' third_party_settings: { } path: type: path diff --git a/sync/core.entity_view_display.node.article.default.yml b/sync/core.entity_view_display.node.article.default.yml index 0d21c3d..c784799 100644 --- a/sync/core.entity_view_display.node.article.default.yml +++ b/sync/core.entity_view_display.node.article.default.yml @@ -58,6 +58,6 @@ content: links: weight: 100 region: content -hidden: - field_image: true - field_tags: true + settings: { } + third_party_settings: { } +hidden: { }
This happens on 8.3.x, 8.2.x, and even 8.1.x, so it is unrelated to #2843074: Stale dependencies passed to onDependencyRemoval() result in data loss on uninstallation or #2796581: Fields must store their region in entity displays.
Proposed resolution
- Figure out why there are supposedly hidden fields disappearing from the hidden field list.
- Probably just re-export the default config with the current valid config.
Remaining tasks
- Use
git blame
to figure out why the tags and image fields are listed both as displayed and hidden, and see if there was any bug. - Create a patch that re-exports any entity view and form displays that have such a mismatch. (Check modules other than Node as well, just in case.)
- Review. Check that the current behavior is still as described above. Apply the patch, reinstall Drupal, and check that there are no changes in stored config after saving the form and view modes.
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#23 | 2843707-23.patch | 1.26 KB | Chirag_Garg |
#10 | 2843707-10.patch | 600 bytes | lokapujya |
Comments
Comment #2
xjmI guess this is probably Node's problem, assuming the default config is just stale and there's not any actual functional bug.
Comment #3
xjmA novice could probably work on this issue. The tasks are:
git blame
to figure out why the tags and image fields are listed both as displayed and hidden, and see if there was any bug.Comment #5
_Archy_ CreditAttribution: _Archy_ at PitechPlus commentedComment #6
_Archy_ CreditAttribution: _Archy_ at PitechPlus commentedTagging went wrong :D
Comment #7
benjifisherComment #8
gerzenstl CreditAttribution: gerzenstl at 42mate commentedComment #9
lokapujya#2321385: Creation of node body field in postSave() incompatible with default config and overrides is the issue that adds:
Comment #10
lokapujyaUse the generated config.
Comment #11
John Cook CreditAttribution: John Cook at Creode commentedI've tested the patch in #10.
While it does fix the problem with
core.entity_view_display.node.article.default.yml
, there is still a problem withcore.entity_form_display.node.article.default.yml
having different configuration so unfortunately back to needs work.I've updated the reproduction instructions to include re-saving the form display and merged together the two file diffs so it doesn't get missed.
Comment #12
John Cook CreditAttribution: John Cook at Creode commentedComment #13
gerzenstl CreditAttribution: gerzenstl commentedSorry, I didn't added what I have found so far over last days.
Following @xjm suggested steps, a
git blame
oncore.entity_view_display.node.article.default.yml
shows thatfield_image
andfield_tags
where set as hidden on the issue #2321385: Creation of node body field in postSave() incompatible with default config and overrides.I couldn't find a good reason of why those fields were set as hidden.
John Cook: The issue it's not only with
core.entity_view_display.node.article.default.yml
andcore.entity_form_display.node.article.default.yml
. I was able to reproduce same issue with the rest of the Article content type view modes ("teaser" or "rss") and with Basic page content type.I can quickly prepare a patch to match the config differences.
But what I'm trying to find out is why on step 4
doesn't place those 2 fields on the "hidden" group the first time the form renders.
Comment #14
gerzenstl CreditAttribution: gerzenstl at 42mate commentedComment #15
vegantriathleteComment #17
michaellenahan CreditAttribution: michaellenahan at erdfisch commentedComment #18
gmario CreditAttribution: gmario commentedIn DrupalCon Vienna - i'm working on this.
Comment #19
Ivan Berezhnov CreditAttribution: Ivan Berezhnov as a volunteer and at Drupal Ukraine Community for Levi9 commentedComment #20
chera.jaswinder CreditAttribution: chera.jaswinder commentedComment #21
vegantriathleteComment #22
Chirag_Garg CreditAttribution: Chirag_Garg commentedComment #23
Chirag_Garg CreditAttribution: Chirag_Garg commentedHi Team,
Can you verify the patch for the mentioned issue.
Comment #24
benjifisherFirst, let's set to NR so that we get a "review" from the testbot.
Normally, we like to see an interdiff to help compare your patch to the previous one on this issue. In this case, I think we can skip that since the patches are so simple. (The patch in #10 has one hunk. The patch in #23 includes that hunk and one additional hunk.)
Comment #10 explains where the inconsistency in the view mode crept in. Can we do the same for the inconsistency in the form mode, as requested in the issue summary?
The issue summary asks for checks on other modules (not just the Node module). I am not sure what we mean by this. We could save config for Basic page as well as Article. Surely we do not want to save every config form that Drupal provides and check that the config is stable as part of this Novice issue.
I think that reviewing this is still a novice task. I will make this explicit in the issue summary.
Comment #25
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedI think testbots are passing it and not able to reproduce as it of now.
Marking it for RTBC, having an issue. Please feel free to mark it as Need works.
Comment #26
benjifisherI am moving this back to NR because "not able to reproduce as it of now" is not enough of a review.
@snehi, please describe the steps you followed in the same level of detail as the issue summary. Do you get different results with and without the patch?
Comment #28
lmirabile CreditAttribution: lmirabile as a volunteer and at Tech-Tamer, LLC commentedEverything works well: I installed 8.6.0, followed the steps above and reproduced the issues exactly as described. I then installed the patch, dropped the database, reinstalled Drupal, and followed the exact steps above. I got no differences when I did a git diff.
Comment #29
lmirabile CreditAttribution: lmirabile as a volunteer and at Tech-Tamer, LLC commentedComment #30
benjifisherComment #31
lmirabile CreditAttribution: lmirabile as a volunteer and at Tech-Tamer, LLC commentedComment #33
catchCommitted/pushed to 8.6.x and cherry-picked to 8.5.x. Thanks!
Comment #36
rosinegrean CreditAttribution: rosinegrean at PitechPlus commentedComment #37
aadeshvermaster@gmail.com CreditAttribution: aadeshvermaster@gmail.com as a volunteer commentedI did not get this issue with drupal 8.5.3. I have followed these steps with using PHP 7.2.5-1, mysql - 5.7.22, and Drupal 8.5.3. Currently, There is no contents of Article Content type. i will try with some article content.
Comment #38
aadeshvermaster@gmail.com CreditAttribution: aadeshvermaster@gmail.com as a volunteer commentedI have also tried these steps after adding 2 article contents and not getting any difference using drupal 8.5.3. Now, i will tried with lower versions drupal 8.3.x.
Comment #39
lokapujyaWas there another issue to test for mismatches?