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
- Gather feedback from the community on whether this permission is useful. Learn what, if any, use cases there are for using this permission.
- Decide whether to proceed with this feature request
- Update #3259464: Improve the Bypass Maxlength permission behavior. accordingly
Issue fork maxlength-3280195
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
Comment #2
davedg629 CreditAttribution: davedg629 commentedI 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!
Comment #3
recrit CreditAttribution: recrit at Phase2 commented@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.
Comment #4
recrit CreditAttribution: recrit at Phase2 commentedThe 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.
Comment #5
recrit CreditAttribution: recrit at Phase2 commentedFor 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.
Comment #6
cedewey@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 -
Comment #8
hawkeye.twolf@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.
Comment #10
cedeweyNice! 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.
Comment #11
ph7 CreditAttribution: ph7 commentedYou 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.
Comment #12
cedeweyAssigning to myself for review. hipp2bsquare will do a code review.
Comment #13
cedeweyI've reviewed this from a user experience standpoint and is all working great. Assigning to hipp2bsquare for the code review.
Comment #16
hipp2bsquare CreditAttribution: hipp2bsquare at DevCollaborative, LLC commentedLooks good. Thanks everyone -- merging this into the project.
Comment #17
hipp2bsquare CreditAttribution: hipp2bsquare at DevCollaborative, LLC commented