Notice: Undefined index: und in wysiwyg_imagefield_after_build() (line 90 of
/sites/all/modules/wysiwyg_imagefield/wysiwyg_imagefield.module).
Notice: Undefined index: #suffix in wysiwyg_imagefield_after_build() (line 91 of /sites/all/modules/wysiwyg_imagefield/wysiwyg_imagefield.module).
Notice: Undefined index: #title in wysiwyg_imagefield_after_build() (line 99 of /sites/all/modules/wysiwyg_imagefield/wysiwyg_imagefield.module).

Comments

deciphered’s picture

Status: Active » Postponed (maintainer needs more info)

Hi euroba,

If you could possibly provide more information on how and when that error occurred I might be able to help out .

Cheers,
Deciphered.

funature’s picture

everything is ok when i create a new node. but this error appears when i try to edit the node again. the popup windows is blank, without the upload form. the upload form shows up at the place where before this module was installed.

deciphered’s picture

Status: Postponed (maintainer needs more info) » Active

Hmm, that's odd. I just followed your steps exactly and was unable to reproduce the issue.

Can you double check you have the very latest dev build (as there where a couple commits recently) and see if you are still able to reproduce the issue.

If so, can you also try reproducing the issue on a fresh site to confirm that it is still an issue with only the essential module enabled?

Cheers,
Deciphered.

milesw’s picture

That looks like the kind of PHP notice you get when PHP error_reporting is set to E_STRICT. Could explain why OP sees notices but you can't reproduce.

RoboPhred’s picture

Title: at beginning it was ok, but i got this later » Notice: Undefined index: und in wysiwyg_imagefield_after_build()
webmindz’s picture

Hello,

recently I've installed and configured this module too and the result is the same error as above described (only the lines are different). But, maybe this helps in solving.

The error message tells that the error occured in this file:
\sites\all\modules\wysiwyg_imagefield\wysiwyg_imagefield.module

But the module is installed in
\sites\all\modules\wysiwyg\wysiwyg_imagefield.module

Unfortunately I am not so experienced in php and module coding, but I thought it might be worth to mention.

Regards,
nachtraaf

filburt’s picture

Same problem here - thanks for support.

Filburt

wim verheyen’s picture

In my case this problem has something to do with the language-settings.
When I use a content type with “multilingual support” = “enabled” in the “publishing options” this module acts strange.
On the “node/edit”-page you can choose for one of the (in the admin section) enabled languages or for “language neutral”. Choosing for the “language neutral” option makes the module work perfect.
Changing the option to “English” and “save” results in following errors:

-messages:
• Notice: Undefined index: und in wysiwyg_imagefield_after_build() (line 96 of C:\XAMPP\htdocs\drupal\sites\all\modules\wysiwyg_imagefield\wysiwyg_imagefield.module).
• Notice: Undefined index: #suffix in wysiwyg_imagefield_after_build() (line 97 of C:\XAMPP\htdocs\drupal\sites\all\modules\wysiwyg_imagefield\wysiwyg_imagefield.module).
• Notice: Undefined index: #title in wysiwyg_imagefield_after_build() (line 105 of C:\XAMPP\htdocs\drupal\sites\all\modules\wysiwyg_imagefield\wysiwyg_imagefield.module).
-in “node/view” state images aren’t displayed anymore, although they still are visible in the wysiwyg editor.
-in “node/edit” state the imagefield placed itself at the bottom of the page, no images are loaded anymore. It is however possible to upload and insert new images. Normally the imagefield should be hidden and works as a popup.
-when you click the imagefield button on the wysiwig editor an empty popup appears.

Going back to “language neutral” and save” resets the normal working of the module but the already inserted images still do display in the editor but won’t appear in the page.
Disabling the “Multilanguage support” in the “content type” solves for me the problem at the moment but this is of course only avoiding the bug.
I tried this on firfox3.6.15 and on Internet Explorer8 with the same result. GoogleChrome9 acts rather in the same way but the “browse-button” issue (node/879786) blocks the rest.

I’m new to Drupal and not a programmer so I can’t support for solutions.

jens peter’s picture

I have the same problem but with different line numbers...

Notice: Undefined index: und in wysiwyg_imagefield_after_build() (line 96 of /var/www/www.domain.com/www/sites/all/modules/wysiwyg_imagefield/wysiwyg_imagefield.module).
Notice: Undefined index: #suffix in wysiwyg_imagefield_after_build() (line 97 of /var/www/www.domain.com/www/sites/all/modules/wysiwyg_imagefield/wysiwyg_imagefield.module).
Notice: Undefined index: #title in wysiwyg_imagefield_after_build() (line 105 of /var/www/www.domain.com/www/sites/all/modules/wysiwyg_imagefield/wysiwyg_imagefield.module).
Notice: Undefined index: menu-submenu in zen_preprocess_page() (line 228 of /var/www/www.domain.com/www/sites/all/themes/zen/template.php).

I have tried to change language but it didn't seem to make any difference.
I only get the error when I enter the edit page. The error is reproduced everytime I add a new picture and if I add 3 in a row, the error will be on the edit page 3 times too.
But if I save the page and reenter the edit area the extras are gone.

I know the last one is an error about the ZEN theme - but I didn't had any errors before I updated ZEN earlier.

Anyone idea would be very welcome.

jens peter’s picture

I have the ZEN error solved now. I still have this issue of the wysiwyg_imagefield error. Can any one help?

jonhattan’s picture

For the notices, the related lines are:

    // Modify file handler element.
    $element[$imagefield][LANGUAGE_NONE]['#prefix'] = "<div id='wysiwyg_imagefield-wrapper'>{$element[$imagefield][LANGUAGE_NONE]['#prefix']}";
    $element[$imagefield][LANGUAGE_NONE]['#suffix'] = "{$element[$imagefield][LANGUAGE_NONE]['#suffix']}</div>";

guess what?

includes/bootstrap.inc:define('LANGUAGE_NONE', 'und');
osopolar’s picture

Nice module btw, but it is not ready for production sites. So I still have to go the IMCE way.

Anyway, I created a patch when I was testing this module. I am not sure if it is the right way to fix it. I haven't enough knowledge about the Field Language API in drupal 7. Please test carefully.

For more information see: http://api.drupal.org/api/drupal/modules--field--field.multilingual.inc/....

deciphered’s picture

Thanks for the patch, looks good in general, will try to make some time to test it.

All real development is being done on the Wysiwyg Fields module, which I am desperately trying to get finished so I can start using it myself, but I haven't yet got a D7 port usable yet.

murz’s picture

osopolar, thanks for patch - I test it, it works good! Will be good to see it in head.

jmones’s picture

patch in #12 worked for me, thank you osopolar

supfred’s picture

The problem comes from IE18n module.
here is my patch in wisiwyg_imagefield.module.php :

Change at line 95 :

//[FT-20110713]
//Récupération de la variable d'internationalisation
$lang = (empty($form_element['language']['#default_value'])) ? LANGUAGE_NONE : $form_element['language']['#default_value'];

// Modify file handler element.
$element[$imagefield][$lang]['#prefix'] = "

{$element[$imagefield][$lang]['#prefix']}";
$element[$imagefield][$lang]['#suffix'] = "{$element[$imagefield][$lang]['#suffix']}

";
// $element[$imagefield][LANGUAGE_NONE]['#prefix'] = "

{$element[$imagefield][LANGUAGE_NONE]['#prefix']}";
// $element[$imagefield][LANGUAGE_NONE]['#suffix'] = "{$element[$imagefield][LANGUAGE_NONE]['#suffix']}

";
// [/FT-20110713]

// Add Javascript.
drupal_add_library('system', 'ui.dialog');
drupal_add_js(
array(
'WysiwygImageField' => array(
'field' => $imagefield,
'title' => $element[$imagefield][$lang]['#title']
// 'title' => $element[$imagefield][LANGUAGE_NONE]['#title']
)
),
array(
'type' => 'setting',
'scope' => JS_DEFAULT,
)
);

W.M.’s picture

The patch at reply #12 works perfectly.

What I love about this small module is that it attaches the desired img style in HTML (as class="name"), a thing that Insert alone was not doing.

I think supplying predefined image classes to choose from would be great add-on for this module: especially for positioning in page (right, left, middle, floating etc..)/

@ Deciphered: Thanks very much :)

shenzhuxi’s picture

I got the same problem.

rolfmeijer’s picture

#12 Did the trick for me too.
Thank you very much, open source power, this is :-).