Problem/Motivation

Currently the "Bypass maxlength" permission automatically applies to the admin role. It hides the countdown message completely. This can throw off admins who think the module is not working or they configured something incorrectly.

It can also be helpful for roles to bypass the setting but still see the countdown message.

Proposed resolution

There are a few options we could take:

Option 1: #3279243: User with 'bypass maxlength' permission sees the character limit message.

Option 2: Display a different message in place of the countdown message on fields with a maxlength. For example, "This field has a 100 character limit but your role has permission to bypass this."

Option 3: Show the Option 2 message in addition to the standard countdown message.

Option 4: Keep the behavior as is, but upon enabling the module display a system message such as, "Admins automatically have the Bypass Maxlength permission."

Option 5: #3280183: Do not grant "Bypass maxlength setting" permission to administrators by default. This is not possible.

Option 6: #3280195: Remove the "Bypass Maxlength setting" permission

Remaining tasks

  1. Gather input from the community
  2. Decide on the best approach
  3. Implement the approach

Comments

cedewey created an issue. See original summary.

cedewey’s picture

Issue summary: View changes
d.sibaud’s picture

for us is useful to have it already checked for admin, but often we must have it applied also for admin roles, so have the checkbox disabled for admin isn't a good choice

cedewey’s picture

Thanks for the feedback Daniele. Of the other four options, do you have a preference?

d.sibaud’s picture

sorry only now I realise my comment was a bit OT and more related to https://www.drupal.org/project/maxlength/issues/3195874 instead,
for this issue I surely opt for the third one.

cedewey’s picture

Great, we'll keep that in mind. Thanks for sharing your thoughts on this.

cedewey’s picture

sinn wrote a patch that implements option 1.

I agree with d.sibaud that option 2 is the ideal approach.

sinn and d.sibaud. Are either of you interested in implementing option 2? If so I'll assign this issue to you.

If not, let's see if anyone else in the community can. If not, the patch that sinn wrote is a sufficient fix for now.

cedewey’s picture

Issue summary: View changes

I interviewed some site builders about this and one brought up a good point, which is, what is the use case for having the Bypass Maxlength setting permission in the first place? If the point of the limit is to have the content adhere to certain guidelines why would any role be exempt from that standard? If the limit isn't crucial then the "Hard limit" option should be unchecked.

If you have opinions on this, especially if you have a use case for keeping this permission. Please leave a comment in #3280183: Do not grant "Bypass maxlength setting" permission to administrators by default.

cedewey’s picture

Issue summary: View changes

@weseze pointed out that #3259464: Improve the Bypass Maxlength permission behavior. is not possible as it goes against how Drupal core handles permissions, which is to automatically assign them to administrators. He also made the important point that by introducing the permission to bypass the Maxlength module, you can then introduce validation errors for the roles that can't bypass the maxlength setting.

I'm strongly leaning towards Option 6, #3280195: Remove the "Bypass Maxlength setting" permission for that reason and the other reasons discussed so far. I'll check in with the other maintainers about this on Monday, June 20th. If anyone else following this issue has thoughts to share, please leave them soon. Thanks!

ericgsmith’s picture

+1 for removing the permission for me.

Its hard to see a use case from my point of view - I'm sure somebody out there could have one, but such edge cases are in my opinion not the norm and the permission introduces some complexity and confusion for site builders that I think are better served by removing the permission.

Thanks for opening the discussion!

phily’s picture

I would go for option 3 that keeps informing about the limits and the ability to override.
With rewriting the 'bypass' message to "Your role has permission to bypass this." added after the regular countdown message.

cedewey’s picture

Category: Feature request » Plan
Status: Active » Fixed

Thanks everyone for sharing your thoughts on this. We've decided to remove the permission entirely in keeping with our values of being

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

The use cases for keeping it weren't compelling enough to expand on the permission's behavior to be more intuitive. Of course, as an open source project, feel free to fork the module to keep the permission and modify it to meet your needs.

Status: Fixed » Closed (fixed)

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