Download & Extend

Error inserting image

Project:Maxlength
Version:7.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:vasi1186
Status:closed (fixed)

Issue Summary

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

#1

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

#2

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

#3

Assigned to:Anonymous» vasi1186

#4

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.

#5

Status:fixed» closed (fixed)

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

nobody click here