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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Spry_Julia created an issue. See original summary.

quiron’s picture

Hi,

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?

JuliaKoelsch’s picture

Yep, 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!

acrosman’s picture

I'm seeing the same issue with a field collection in a bean.

cristiroma’s picture

The 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.

Soubi’s picture

Any hint on this issue ?

Soubi’s picture

May be the begining of a solution ;)

Johan den Hollander’s picture

This patch restores the functionality for me.

deker0’s picture

Just 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!

cedewey’s picture

Status: Active » Needs review
cedewey’s picture

Status: Needs review » Closed (won't fix)

We 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.

undersound3’s picture

For 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).