I have a multilingual website using Drupal 7. The 1st développer didn't use Views.

I installed i18n modules (entity translation, etc ) Un templates I have been using variables like $vars['und' ] (for undefined)

I think drupal ran update and now the template system uses $var without the language as key.. I think I activated block translation.. Other thing : (I purged caches) template still work as disconnected user but doesn't work as administrator.

Do you know what's happend ?

Thanks for your help Mario


Once you are logged in, another language is requested and the 'und' key no longer works: https://www.deeson.co.uk/labs/programatically-access-field-data-using-entitymetadatawrapper-drupal Try replacing your use of $vars['und'][0]['value'] with Entity metadata wrappers. More examples here: https://www.drupal.org/documentation/entity-metadata-wrappers

  • You are right. I think that field_get_items will also work in this situation. Oct 21 '14 at 4:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.