Problem/Motivation

People are regularly confused by the Bypass Maxlength setting permission. The use case for this is unclear. If a character limit is desired for a text field, why would certain roles by allowed to exceed it? If a limit is not crucial, the limit method can be "soft."

Also, the bug that was preventing this permission from working existed for a long time and few people complained about it.

Proposed resolution

Simply removing the permission would make the module easier to configure and simplify the codebase.

Remaining tasks

  1. Gather feedback from the community on whether this permission is useful. Learn what, if any, use cases there are for using this permission.
  2. Decide whether to proceed with this feature request
  3. Update #3259464: Improve the Bypass Maxlength permission behavior. accordingly

Issue fork maxlength-3280195

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cedewey created an issue. See original summary.

davedg629’s picture

I think a proper bypass option would be on a per field basis and would provide the option to choose which roles can bypass. And it would not be turned on by default.

Thanks for reviewing this!

recrit’s picture

@cedewey The permission helps in the following use cases:
1. A field widget that was unlimited OR limited to a higher character count, and then updated to a lower limit. This permission allows administrators to correct the content - truncate with the context in mind or copy the full text to a new field (if one was created).
This is useful so that the content truncated is not lost.

2. An admin might need to temporarily add text but does not want to rework the entire copy.

recrit’s picture

The patch in #3279243: User with 'bypass maxlength' permission sees the character limit message. attempts to add a soft limit for admins - display the count while not enforcing the limit.

recrit’s picture

For reference, the CKEditor Wordcount module can be configured to lock the editor when the limit has been reach by entering content to get to the limit. For existing content that may exceed the limit, it displays a negative count but does not attempt to truncate the HTML. In that case, it is up to the user to fix the content.

cedewey’s picture

@recrit

Thanks for noting these use cases.

A few thoughts,

For use case #1 a current workaround is to uncheck the Hard limit option. I agree that a better behavior is to do what you pointed out that CKEditor Wordcount does - show all of the text with the negative character count.

For use case #2 unchecking the Hard limit option also seems like a viable workaround.

Curious what folks think about those as solutions instead of keeping this permission.

Also, for this conversation, we should all keep in mind the recently adopted values of this project -

  • helpful for authors
  • intuitive for site builders
  • sustainable for site owners
  • extendable for developers

hawkeye.twolf made their first commit to this issue’s fork.

hawkeye.twolf’s picture

@cedewey, your explanation of using the Soft limit option in both of those cases makes sense to me. I needed this patch for a project and so went ahead and created a fork with the changes. I don't know if any database updates are needed for existing sites using the permission... In my case it wasn't actually enabled on any roles, so there was no cleanup needed.

cedewey’s picture

Status: Active » Postponed

Nice! Thanks for contributing this back to the issue queue. We're gathering more research at the moment to decide on the best path forward. Your fix will be handy if we choose to remove the permission altogether.

Marking as Postponed until we reach a decision in #3259464: Improve the Bypass Maxlength permission behavior.

ph7’s picture

You can keep the permission, but make it fully configurable. As user 1, I cannot deselect the administrator role from not displaying the character limit. As I both create content and administrate my website I want to be able to see (and use) the character limit in the summary field. This flexibility is now gone in the latest 2.0.rc2 release.

cedewey’s picture

Assigned: Unassigned » cedewey
Status: Postponed » Needs review

Assigning to myself for review. hipp2bsquare will do a code review.

cedewey’s picture

Assigned: cedewey » hipp2bsquare

I've reviewed this from a user experience standpoint and is all working great. Assigning to hipp2bsquare for the code review.

hipp2bsquare made their first commit to this issue’s fork.

hipp2bsquare’s picture

Looks good. Thanks everyone -- merging this into the project.

hipp2bsquare’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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