Commit 8bf97206 authored by Hawkeye Tenderwolf's avatar Hawkeye Tenderwolf Committed by Jeff Hipp
Browse files

Issue #3280195 by hawkeye.twolf, cedewey, recrit, ph7, davedg629: Remove the...

Issue #3280195 by hawkeye.twolf, cedewey, recrit, ph7, davedg629: Remove the "Bypass Maxlength setting" permission
parent 4c59d8c1
Loading
Loading
Loading
Loading

maxlength.permissions.yml

deleted100644 → 0
+0 −3
Changes for maxlength.permissions.yml: 0 added lines, 3 removed lines.
Original line number Diff line number Diff line
bypass maxlength:
  title: 'Bypass maxlength setting'
  description: 'If a maxlength is configured for a certain field, the user does not see the value.'
+0 −7
Changes for src/MaxLengthCallbacks.php: 0 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -27,13 +27,6 @@ class MaxLengthCallbacks implements TrustedCallbackInterface {
   *   The processed render array.
   */
  public static function maxlengthPreRender($element) {
    if (\Drupal::currentUser()->hasPermission('bypass maxlength')) {
      if (isset($element['#attributes']['maxlength'])) {
        $element['#attributes']['maxlength'] = $element['#maxlength'] ?? -1;
      }
      return $element;
    }

    if (isset($element['#maxlength_js']) && $element['#maxlength_js'] === TRUE) {
      if (isset($element['#attributes']['data-maxlength']) && $element['#attributes']['data-maxlength'] > 0) {
        $element['#attributes']['class'][] = 'maxlength';