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.
By doing this, the user can toggle back and save, no harm done. However, it allows you to save both the default value and format in one hit.
If you like this idea, I can look at rolling a patch. Should be a trivial field info alter, but I haven't looked
Comments
Comment #1
dragonwize CreditAttribution: dragonwize commentedI am not really understanding the request. Can you explain further?
Comment #2
Alan D. CreditAttribution: Alan D. commentedThis has less importance with the ordering override, but when you visit the instance settings page after just adding a Long Text field to a bundle, the Default field defaults to plain text, with no format selection option. So to set this, you need to save the instance then re-edit it to correctly save the default value & format.
So I guess, adding a checkbox to the page "admin/config/content/formats/settings", something like:
Due to the ordering, you can now do this by setting the desired format to show first, so happy if you mark this as "won't fix".
Comment #3
dragonwize CreditAttribution: dragonwize commentedIt took me awhile but I finally understand what you are talking about.
Yes you are right, I have know about this for awhile. But as you mention, with the ability to change the default ordering I am considering taking the "Use field default" option out completely. Everything can be done with a mixture of the 2 new field level options but it is not always very clear on how to do it.
Comment #4
Alan D. CreditAttribution: Alan D. commentedNot sure what the first option does internally, but this is a real benefit when creating new fields.
Small patch attached that does this. Tested on 7.x-1.x-dev from 2011-09-16, but applied to 7.x-1.x, so a bit stale in relation to the testing against the main branch.
Comment #5
dragonwize CreditAttribution: dragonwize commentedThe first option is the only thing that makes the second option useful.
Without the first option checked the second option would only work if you typed something into the text box as a default. Changing the format only with the text box empty would not save the format as a default format, unless the first setting is checked.
This was a quick per field default format option that I added early on in the D7 branch but now with the new D7 features I am considering taking that feature out completely as it can all be done with the new features and is confusing.
Comment #6
Alan D. CreditAttribution: Alan D. commentedBetter descriptions.
Comment #7
Alan D. CreditAttribution: Alan D. commentedcross-post :)
Very true, although the second option is actually useful when creating new fields, but it is an easy mod in a custom module if needed (if you are a programmer)
Comment #8
darrell_ulm CreditAttribution: darrell_ulm commentedThe patch in #6 still applies and appears to work correctly for formats tested.
It's up to @dragonwize for the go-ahead or won't-fix status on this.
Cheers,
Comment #9
dragonwize CreditAttribution: dragonwize commentedI think the new ways are better. However, this has been in here so long now, we would need to make a plan, ie probably a new version, to take it out.
Comment #11
joseph.olstadComment #12
joseph.olstadReleased this:
https://www.drupal.org/project/better_formats/releases/7.x-1.0-beta3
And for those using PHP 8.0, PHP 8.1, PHP 8.2, use the latest 2.0 release (currently 7.x-2.0-beta1)
https://www.drupal.org/project/better_formats/releases/7.x-2.0-beta1