after updating my site this module is now falling over and bringing down the display of nodes with this error.
here is the error.
Notice: Undefined index: en in _nodeconnect_field_attach_form() (line 15 of /var/www-sites/drupal/drupal-7.0/sites/golegal.co.za/modules/nodeconnect/nodeconnect.form.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | languagefixes-1194454-10.patch | 1.24 KB | rv0 |
| #8 | 1194454.patch | 548 bytes | e2thex |
Comments
Comment #1
roam2345 commentedsteps to reproduce this
1. enable "Content translation" core
2. create a piece of content using this module
3. now disable "Content translation"
BOOM.
can get the error to go away by reenabling the module "Content translation" but I want to disable the module.
Comment #2
e2thex commented@jucallme
This seems like a caching issue of some sort. as that value of en is getting passed in maybe there is some content that is still marked as being english?
Comment #3
roam2345 commentedwhen you create content after enabling content translation, it is marked as the language it is created in, even if i update that content it is still en, as that is set on node create, i can change it to another none english language but not to neutral as that is only the case with out content translation. + i would loose a fair amount of content having to do this.
There is no way to move it from en to def .. that i know of.
Comment #4
kamenrs commentedHere is the error message:
This occurs when I create a new node with nodeconnect and then reopen it to edit. The module is working but the message is there. I don't have i18n module and the the Multilingual support is disabled for this node type.
Comment #5
Frederic wbase commentedbump, i have the same issue with the latest dev version on a multilanguage site
Comment #6
mpotter commentedI ran into this on a site I was working on. In our case we used Features for some content types. When a new field is added to a content type on a multilingual site, the exported feature code shows:
'translatable' => '0',in the *_field.inc file. This causes the $language of the field to be "und" instead of "en" (or whatever your default language is). When nodeconnect tries to loop through the form using
foreach ($form[$field_name][$language] as $key => $field) ...it fails because this field doesn't have a correct language entry.
In our case, editing the feature *_field.inc file and changing 'translatable' to 1 like this:
'translatable' => '1',and then clearing the Drupal cache fixes the problem.
I'm not sure if this is really something for NodeConnect to fix or not. If you have a field in your content type with the wrong language, that will probably cause issues elsewhere on your site.
If you turned on Content translation, that probably got the language fields in your content type updated to "en" and then when you turned it off, the language of the fields might have been changed to "und". You would then need to somehow set your site's language back to "und" to fix this error.
In any case, my advice for anybody with this error is to go to the content type for the type of node you are editing and Export it and look at the export to see what the values of the translatable property are. If you are not using Features, I'm not exactly sure how to fix it other than some raw database editing, but somebody else might have a solution.
Comment #7
daniela basualdo commentedI have the same Problem:
Configuration:
- default language is GERMAN
- Content Translation DISABLED because it's a non multilanguage site. don't need to translate fields.
- Module Locale activated for Suface Translation from english to german
- Module Nodeconnect 7.x-1.x-dev installed
The nodereference field i use with nodeconnect has the field language = 'und' because it's not translatable.
Now i did the following steps:
Step 1:
- I create a new node: Error does not appear because $langcode (from _nodeconnect_field_attach_form()) is set to 'und'
- could create reference node with nodeconnect, no problems.
Step 2:
- open up again the same node: Error appears because $langcode is se to "de"
Is there a possiblity to fix this somehow or create a workaround?
thnx in advance
Comment #8
e2thex commentedso I am not sure if this could effect it but on line 28
This seems wrong and we should be using what comes in from the function call.
Attached is a patch for this (I am going to commit it any way as this is a bug) can you all see if this is some how causing the issue?
Comment #9
Rechi commentedDidn't work for me.
Setting
$language ='und';on line 15 removed the error for me,
although this is just a dirty hack
Comment #10
rv0 commented1) instead of 'und' the constant LANGUAGE_NONE should be used
2) its not taking field specific languages into account.. some fields can be 'und', others can be localised.
I'm not sure if I should fix it in that function or in the function calling it (or elsewhere?)..
But here's a quick patch anyway
(patch created at Coworks)
Comment #11
kamenrs commentedThis patch works fine for me.
Many thanks rv0.
Comment #12
e2thex commentedOk this is clearly the right way and if it fixes the problem even better!
will commit
Comment #13
e2thex commentedThanks for the patch, (and the typo fix)
commit 7d0ea3bf0a1e38c9601c6de25aaabd435ee810aa
Date: Tue Sep 13 11:26:30 2011 -0400
Issue #1194454 by rv0 at Coworks : Notice: Undefined index: en in _nodeconnect_field_attach_form()