After upgrade from previous version, nodes with nodeblock field can't be saved, because of error:

    field_block cannot be longer than 128 characters but is currently 136 characters long.
    field_block cannot be longer than 128 characters but is currently 131 characters long.
    field_block cannot be longer than 128 characters but is currently 147 characters long.
    field_block cannot be longer than 128 characters but is currently 143 characters long.
    field_block cannot be longer than 128 characters but is currently 132 characters long.
    field_block cannot be longer than 128 characters but is currently 137 characters long.
    field_block cannot be longer than 128 characters but is currently 148 characters long.

It's because input field have value logner than maxlength:

input aria-autocomplete="list" autocomplete="OFF" id="edit-field-block-und-0-moddelta" name="field_block[und][0][moddelta]" value="(Nodeblock: Basic page): Megafestival Weekend Festival Baltic taas Pärnu rannas! [nodeblock:6272]" size="60" maxlength="128" class="form-text form-autocomplete" type="text"

How to fix this?

Comments

egontinno created an issue. See original summary.

Johnny vd Laar’s picture

Project: Nodeblock » Block reference
Version: 7.x-1.7 » 7.x-1.x-dev

What module provides this field because nodeblock doesn't have a "moddelta" field?

I assume that it is blockreference module. It is not an error that nodeblock generates, so not a problem that nodeblock can repair.

Moving this ticket to blockreference.

rudiedirkx’s picture

Version: 7.x-1.x-dev » 7.x-1.16

Thanks Johnny.

Drupal's textfields are apparently 128 max by default. Your block label + moddelta is more.

The db field is max 129 (don't ask), which should be enough.

Will fix.

  • rudiedirkx committed 0bf4104 on
    Issue #2658846: Field_block cannot be longer than 128 characters
    
rudiedirkx’s picture

Status: Active » Fixed

@egontinno Can you try this patch and let me know if that fixes it?

If it does, I'll create a new release. It's time.

egontinno’s picture

Yes, patch fixes the problem. Thank you!

rudiedirkx’s picture

Excellent. I'll make a new release.

Status: Fixed » Closed (fixed)

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

Chris Charlton’s picture

Sorry to bug about this ticket but the commit added '#maxlength' => 999 so how does that help control a 128 character limit?
What is the real (or sane) limit? because I doubt it's 999 characters, which is what the patch allows.

rudiedirkx’s picture

There's no limit, technically, because the input's value isn't used or saved entirely. You could have block info's of 3000 chars. Very unlikely though. 999 is good enough for me. If it's not good enough for you, you can widget alter or form alter another limit.