Problem/Motivation

#784672: Allow text field to enforce a specific text format finally landed in core.

As commented there in #299, this module should provide an upgrade path now. I see that D10 compatibility was releases as a new major version, that wasn't actually required, it's fine in regards to BC and semver to increase min version of requirements as long as your own API doesn't change.

It's a little bit awkward now, because for this, it really does make sense to have a new major version. So we have a major version for exactly one minor core version :) The idea is to remove all code related to the allowed formats setting and add an update function that moves existing configuration to the core setting.

For extra awkwardness, not all functionality of this module is in core yet, see #3323007: Add an option to 'hide filter guidelines' on text fields, so we can't remove that yet unless we also get that issue into core for 10.1.

Steps to reproduce

Proposed resolution

  1. Create an upgrade path for a site builder to migrate their allowed formats settings into Drupal core's settings
  2. Remove the allowed formats feature from this contributed module.
  3. Rename the module to Hide format info (former Allowed Formats)
  4. Update the project description to Hides info about the selected text format. The 'allowed formats' functionality has been moved in core since Drupal 10.1.0.
  5. Update the README.md explaining these changes.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon 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:

Comments

Berdir created an issue. See original summary.

berdir’s picture

Issue summary: View changes

I'll look into providing a patch here if nobody beats me to it, but I'll wait a bit to see where that other issue goes.

moshe weitzman’s picture

So lets offer a 3.x branch that has the upgrade path?

berdir’s picture

Yes, "lets" do that ;)

That was my proposal, the problem is just that we still need 50% of what this module does, I guess it's unlikely at this point that the referenced issue will get into 10.1. So we have a 3.x that makes allowed_formats really a hide_format_explanation.module, and then maybe a 4.x for a future core version that also removes the need for that bit with another upgrade at which point the module is no longer needed.

klemendev’s picture

I agree 3.x with the missing 50% in the core would be good idea

pcate’s picture

So we have a 3.x that makes allowed_formats really a hide_format_explanation.module, and then maybe a 4.x for a future core version that also removes the need for that bit with another upgrade at which point the module is no longer needed.

This sounds like a good path forward for this module. I just updated a client site to D10 and having two sets of "allowed formats" settings on fields is confusing for site builders. But we still really need the hide tips/guidelines functionality.

scotwith1t’s picture

I just updated a client site to D10 and having two sets of "allowed formats" settings on fields is confusing for site builders. But we still really need the hide tips/guidelines functionality.

Seems like this functionality should not have rolled out in core without coordinating with this module to provide that new version/upgrade path. Current users of this module are now confused/penalized by having 2 sets of these checkboxes in the UI and existing field config data stored by the contrib module until an upgrade path is figured out. Will keep an eye on this, for sure.

claudiu.cristea made their first commit to this issue’s fork.

claudiu.cristea’s picture

Assigned: Unassigned » claudiu.cristea

I’m working on this

claudiu.cristea’s picture

Assigned: claudiu.cristea » Unassigned
Status: Active » Needs review
Issue tags: +Needs followup

Ready for review. Also, as per #4, we need a followup in Drupal core to move also the "hide explanations" feature to core.

claudiu.cristea’s picture

berdir’s picture

Very nice, with tests and everything! ;) This was on my list, but didn't get to it yet. Added some comments.

claudiu.cristea’s picture

Hm, just saw now that testing is not enabled for 2.x :( It would be good to see tests here

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Tested a bit on our project, seems to work fine. As mentioned, the idea is to commit this to a new 3.x branch.

claudiu.cristea’s picture

I’ve tried to contact the maintainers but got no answer so far. To summarize:

  • This needs to be merged in a new 3.x branch
  • Tests should be enabled for 3.x branch with D10.1
  • Cut a 3.0.0 release
luke.leber’s picture

This all looks awesome overall.

One question -- is the allowed_formats_field_config_presave really needed? I don't believe that I've seen this pattern before -- even in core data updates. It seems to be pretty widely understood that running database updates is an important step in the CI/CD/manual upgrade process.

Definitely not a blocking review, and can easily be removed in 4.x whenever core adopts the pending widget config settings. I'm more curious from a learner's perspective than anything.

berdir’s picture

Yes, that is in fact the pattern that core is mostly using, See my review comments which also mention an example.

acbramley’s picture

Ran this update on our project with over 50 formatted text fields and all updated as expected, great work!

claudiu.cristea’s picture

Version: 2.0.x-dev » 3.0.x-dev

  • claudiu.cristea committed 85c237b3 on 3.0.x
    Issue #3324446: Allowed formats are in Drupal 10.1 now, add an upgrade...
claudiu.cristea’s picture

Status: Reviewed & tested by the community » Fixed
claudiu.cristea’s picture

Will cut a 3.0.0-alpha1 release to be evaluated by the community

tgoeg’s picture

I can confirm the set allowed format (a reduced HTML set) for a text field was properly migrated over after updating to 3.0.0-alpha1 and performing an updb step.
And I can only use the allowed format afterwards.

So it works as it should from my side, thanks!

cedewey’s picture

Issue summary: View changes

Updated the agreed upon resolution so it's easier for people to understand how this issue was resolved.

claudiu.cristea’s picture

I think the project page needs also an update, same as for the README but I have no permission to do that

chrissnyder’s picture

3.0.0-alpha1 worked for me and was able to update to Drupal 10.1's built in allowed_formats setting.

claudiu.cristea’s picture

I've released 3.0.0 and added there release notes about this important change. I've also added those explanations to the module's front page https://www.drupal.org/project/allowed_formats

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.