Hi,

It will be really nice and handy if possible to add the Count option avaialble in the webform element "Textarea" which will limit entered value to a maximum number of characters or words to the webform element "Buttons other".

More specifically, to be added within the other option settings so when a user select the button "other" to write his own custom text, he will be limited by a specific number of characters or words.

Thank you,

Comments

C.E.A created an issue. See original summary.

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    
jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new10.16 KB

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

  • jrockowitz committed c9f437f on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    

Status: Needs review » Needs work

The last submitted patch, 10: 3007974-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new21.11 KB
c.e.a’s picture

The patch in #18 throw this error:

3007974-18.patch:196: trailing whitespace.
error: patch failed: src/Plugin/WebformElement/OptionsBase.php:74
error: patch failed: src/Plugin/WebformElement/OptionsBase.php: patch does not apply.

Thank you,

jrockowitz’s picture

StatusFileSize
new22.9 KB

Please try the attached patch.

c.e.a’s picture

The patch in #20 returned an error:

$ git apply 3007974-20.patch
error: patch failed: src/Plugin/WebformElement/OptionsBase.php:74
error: src/Plugin/WebformElement/OptionsBase.php: patch does not apply
error: patch failed: src/Plugin/WebformElement/TextBase.php:176
error: src/Plugin/WebformElement/TextBase.php: patch does not apply

Thank you,

  • jrockowitz committed 65b91e0 on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    
  • jrockowitz committed ec6caa6 on 3007974-other-counter
    Issue #3007974: Add the count option to the buttons others element
    
jrockowitz’s picture

I am able to apply the patch locally and Drupal.org is able to apply the patch to run the tests.

Below is the command I am using on OSX.

curl https://www.drupal.org/files/issues/2018-10-20/3007974-20.patch | git apply -

Another option would be to check out the '3007974-other-counter' branch.

  • jrockowitz committed 4b8bd81 on 8.x-5.x
    Issue #3007974 by jrockowitz: Add the count option to the buttons others...
jrockowitz’s picture

Status: Needs review » Fixed

I reviewed and committed the patch. Please download the latest dev release to review.

  • jrockowitz committed 6c39de5 on 8.x-5.x
    Issue #3007974: Add the count option to the buttons others element. Fix...
c.e.a’s picture

Dev version reviewed/tested and working like charm !

Thank you for your kind help,

Status: Fixed » Closed (fixed)

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