Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm still determining the way to fix this, but this module is not working for textareas contained within a field collection. Walking through the code, the maxlength_feild_attach_form function detects correctly that the field has a maxlength_js setting, but fails the additional check within the _maxlength_children function.
Anyone else run into this?
Thanks,
Julia
Comment | File | Size | Author |
---|---|---|---|
#12 | fields_in_container-2639968-8.patch | 3.48 KB | undersound3 |
#7 | fields_in_container-2639968-7.patch | 3.44 KB | Soubi |
Comments
Comment #2
quironHi,
I have this module working nice in field collection textfields and textareas. Can you report more information? Is your configuration working for other 'normal' fields?
Comment #3
JuliaKoelsch CreditAttribution: JuliaKoelsch at Spry Digital, LLC commentedYep, I have more information now, but not a solution yet. The text field is in a collection, and that collection is also within a collection. I think this level of nesting was not anticipated in the _maxlength_children function.
We have set aside real-time validation for this field for now, since the project deadline is looming. Hopefully will have a chance to get back to it once things settle down.
Since I doubt most people do this with field collection, it's definitely an edge case. Thanks for checking in on it!
Comment #4
acrosmanI'm seeing the same issue with a field collection in a bean.
Comment #5
cristiroma CreditAttribution: cristiroma commentedThe problem appears also while integrating with entity_collection module, because of the structure of the renderable array:I was testing with 'admin', which bypasses limitations. It works fine also with entity_collection. Sorry for the inconvenience.
Comment #6
SoubiAny hint on this issue ?
Comment #7
SoubiMay be the begining of a solution ;)
Comment #8
Johan den Hollander CreditAttribution: Johan den Hollander at Finalist commentedThis patch restores the functionality for me.
Comment #9
deker0 CreditAttribution: deker0 commentedJust wanted to check in on a solution to this reported issue. I see comment #8 mentions that the patch resolved the issue. Any chance this will make it into a near future release? Thanks!
Comment #10
cedeweyComment #11
cedeweyWe are putting a feature freeze on the Drupal 7 version of the module, so I'm marking this Closed, won't fix. Thank you to each of you for working on this issue. If you do want to maintain the Drupal 7 version, do reach out. We'd be happy to bring you on board as a maintainer.
Comment #12
undersound3 CreditAttribution: undersound3 at Finalist commentedFor those that are experiencing below warnings here is a small adjustment to the patch in #7
Warning: Undefined array key "#type" in _maxlength_children() (line 176 of /var/www/html/web/sites/all/modules/contrib/maxlength/maxlength.module).