Follow up for #552604: Adding new fields leads to a confusing "Field settings" form

Problem/Motivation

As shown in that issue, the global settings tab has a warning that say the settings there cannot change, but some of them can, the site builder just needs to be *careful* and know what they are doing. The warning message is not accurate.

confusing-s07-fieldsettingswithcontentexisting-2012-11-27_1016.png

Proposed resolution

Make the warning message accurate.
Something like: "Some of these cannot change. Some you need to be sure, and know what you are doing." But with better phrasing.

Remaining tasks

Discuss exact wording.
Implement the change, provide patch
review patch
A screenshot with the fix would be nice.

User interface changes

Just a change to a warning message.

API changes

No api changes anticipated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

YesCT’s picture

changes to a warning. current proposed warning: "There is data for this field in the database. Some changes to global field settings should no longer be made and might result in loss of data."

Also changes the help text. "These settings apply to the _fieldname_ field everywhere it is used. These settings impact the way that data is stored in the database."

globalwarning-s01-2012-12-29_0325.png

Questions:
Are both statements always both true?
Are settings here all dealing with how the data is stored in the database? Or are some of the settings on the edit tab also dealing with how the data is stored in the database?
Are settings here all shared across things (bundles/content types) that re-use a field? Is every shared field setting here? Or are some on the field edit tab? Are any here not shared and unique field instances settings?

I'm wondering if there might be shared settings that do not have to do with how the data is stored. Perhaps we just dont have a case like that, and we are not planning to.

YesCT’s picture

Issue tags: -API change
jair’s picture

Issue tags: +Needs reroll
yoroy’s picture

What's not ideal about using the word 'Some' is that it does not give any direction. In a way it might make this more annoying. Saying something bad might happen without a clue as to what or where is not helpful nor anymore specific.

I have no answer to your questions :)

tim.plunkett’s picture

Status: Needs review » Needs work

The last submitted patch, drupal-warning_global_field_settings-1854990-1.patch, failed testing.

stefank’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
1.8 KB
179.69 KB

Rerolled patch from #1.

jhedstrom’s picture

Version: 8.0.x-dev » 8.1.x-dev

I think this has to go to 8.1 since beta string freeze.

swentel’s picture

Version: 8.1.x-dev » 8.0.x-dev

String freeze is only to RC - unless that suddenly changed ?

jhedstrom’s picture

Nope, I had it wrong--I misread another issue.

jecunningham2281’s picture

Assigned: Unassigned » jecunningham2281
jecunningham2281’s picture

Rerolled patch against head. Runs clean now. Patch attached.

mikemiles86’s picture

Issue tags: +SprintWeekend2015

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
Lendude’s picture

Status: Needs review » Needs work
+++ b/core/modules/field_ui/src/Form/FieldStorageEditForm.php
@@ -95,7 +95,7 @@ public function buildForm(array $form, FormStateInterface $form_state, FieldConf
     // If so, prevent changes to the field settings.
     if ($field_storage->hasData()) {
-      $form['field_storage']['#prefix'] = '<div class="messages messages--error">' . $this->t('There is data for this field in the database. The field settings can no longer be changed.') . '</div>' . $form['field_storage']['#prefix'];
+      $form['field_storage']['#prefix'] = '<div class="messages messages--warning">' . $this->t('There is data for this field in the database. Some changes to global field settings should no longer be made and might result in loss of data.') . '</div>' . $form['field_storage']['#prefix'];

This comment is wrong too, we should update it or just remove it, the code is pretty self explanatory right?

Lendude’s picture

Also needs a reroll

ankithashetty’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
1.62 KB
3.56 KB

Here is the rerolled patch of #12. Also removed the comment as the code is self explanatory, just like suggested in #24.

Thanks!

Status: Needs review » Needs work

The last submitted patch, 26: 1854990-26.patch, failed testing. View results

Lendude’s picture

@ankithashetty thanks! Reroll looks good.

Seems like we now also need to update the text in \Drupal\Tests\datetime\Functional\DateTimeFieldTest::testDateStorageSettings were we are testing for this.

yogeshmpawar’s picture

Assigned: jecunningham2281 » Unassigned
Status: Needs work » Needs review
FileSize
2.66 KB
1.04 KB

Tried to fix test failures.

Status: Needs review » Needs work

The last submitted patch, 29: 1854990-29.patch, failed testing. View results

yogeshmpawar’s picture

Status: Needs work » Needs review
FileSize
3.68 KB
1.01 KB

Another try to fix test failures.

ajaypratapsingh’s picture

#31 patch is working fine for me on Drupal 9.3.x local machine and sharing screenshot...
issue can be moved to RTBC

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
FileSize
144 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.