When I go to the translate page of a node I get the following error

Notice: Undefined index: #node in maxlength_form_alter() (line 188 of /home/vrijlab/domains/fablabamersfoort.nl/public_html/beta/sites/all/modules/maxlength/maxlength.module).
Notice: Trying to get property of non-object in maxlength_form_alter() (line 188 of /home/vrijlab/domains/fablabamersfoort.nl/public_html/beta/sites/all/modules/maxlength/maxlength.module).

Line 188 contains:
if (strpos($form_id, '_node_form') !== FALSE && variable_get('maxlength_js_' . $form['#node']->type, FALSE)) {

It doesn't seem to actually break something. But it does scare people a bit.

Comments

Schnitzel’s picture

Status: Active » Closed (fixed)

fixed, commit e345fed added to the 3.x-dev branch, will be in the next DEV version in a couple of hours.

thanks to vasi1186 for fixing this

radoo’s picture

Title: Error in translate node page » Error inserting image
Version: 7.x-3.0-beta1 » 7.x-3.x-dev
Status: Closed (fixed) » Active

Notice: Undefined index: #value in maxlength_validate_input() (line 174 of /home/rado/www/first_lady/sites/all/modules/maxlength/maxlength.module).

Line 174 contains:
$value = filter_xss(str_replace(array("\r\n", ' '), array(' ', ' '), $element['#value']), array());

temporarly i add "&& isset($element['#value'])" at line 171

so line 171 became:
if (isset($element['#attributes']['maxlength']) && isset($element['#value'])) { ....

instead of :
if (isset($element['#attributes']['maxlength'])) { ....

I think the source of error is that field type image doesn't have value for maxlength

Wish you bring better solution to fix this

Schnitzel’s picture

Assigned: Unassigned » vasi1186
vasi1186’s picture

Status: Active » Fixed

The patch in this issue: http://drupal.org/node/1416608#comment-5710640 should fix this. It was applied to the 7.x-3.x branch.

Status: Fixed » Closed (fixed)

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

  • Commit e345fed on 7.x-3.x, 8.x-1.x by Schnitzel:
    issue #1346796 by peteruithoven: check if the #node key is set in the...