after updating this module, i'm getting this error on any page expect the admin:
Fatal error: Call to a member function translate() on a non-object in /drupal/sites/all/modules/views/includes/base.inc on line 157

I'm using views 7.x-3.0-rc1


This can be addressed following the instructions here: http://drupal.org/node/1251706#comment-5628680


irishdan’s picture

anybody else have this problem?

hatznie’s picture


I'm having the exact same error when installing this module. I'm also using views 7.x-3.0-rc1. But I hadn't any version installed before it. So I don't think it's due to updating imho.

I find it strange it's having an issue with some code out of the views module. Therefor I'm not sure if something can be done out of this module. But I'll leave that to the coding experts...


tempo22’s picture

Status: Active » Closed (fixed)

i worked a bit on this and somehow the localization_plugin of views was not set.

I had to go back in views advanced setting to reselect the core localization

irishdan’s picture

After updating to the I got this message too. The previous version worked fine for me.

How do I set the "localization_plugin" of views? You mean the "Query settings"?


cloporto’s picture

Hi, I am having exactly the same problem!!

Did you find a solution?


hatznie’s picture

@Tempo22: I've looked how the setting was set in my website and it was already set on "core". Still having the error though.

miro_dietiker’s picture

As long as you're on "core" setting, it has nothing to do with i18nviews.

If you don't enable the plugin in views settings, you should simply disable / uninstall the module. (Except you're only using some handlers...)

irishdan’s picture

Status: Closed (fixed) » Active

If your setting is on "core" then it doesn't localize exposed filter labels etc. I don't think this issue is fixed.

With it set to "Internationalization Views" I get this error.

webflo’s picture

Status: Active » Needs work

Download the latest Version of ctool, views and i18nviews. Clear the cache. This fixed the problem for me.

@ Miro: I think we should a a empty hook_update_N. Do trigger a cache clear and class registry rebuild. Because we added the i18nviews.inc.

miro_dietiker’s picture

A proper update always clears the cache...

Is this really common to other modules? Sounds like a bad core limitation...
So we cannot expect from users to clear the cache themself? :-)


irishdan’s picture

I have the latest version of all projects, and latest version of i18nviews (22 Aug) but I'm still getting this error. If I try to clear the cache I also get this error.

@webflo are your using the dev or the rc1 version of views?

webflo’s picture

No. Latest dev. git checkout.

czigor’s picture

I'm getting the same. I have views rc1 and ctools rc1. Clearing the cache also gets stuck with this error.

webflo’s picture

Can you provide a backtrace?

czigor’s picture

Updating views and ctools to latest dev solved for me.

miro_dietiker’s picture

alauzon’s picture

Thanks czigor, I installed latest dev for views and ctools and that fixed it for me.

czigor’s picture

Status: Needs work » Fixed

Then lets mark this fixed

marktheshark’s picture

Has this been confirmed to be definitely fixed through updating to latest dev of ctools and views? I'm having the same issue with latest stable versions of these modules. Clearing cache also crashes as reported in #11.

dc-hokie’s picture

I have run into this error after installing the module. It has caused a massive issue as I removed it, received different cascading set of errors and ended up removing admin menu, views and ctools as a result. Was attempting to get back to how my site was setup earlier, then re-install ctools, views, admin menu, so I could be back to where all was working just before installing Internationlization views. But now I get same error just trying to reinstall views. This has messed up my site, pulling my hair out now!!

I need some help please on how to fix this.

marktheshark’s picture

Tried the latest dev for Ctools and Views and it works now, though I have been unable to actually translate anything yet, except for one or two Views titles.

sfyn’s picture

I am not sure it is appropriate to mark an issue that is fixed by the installation of dev snapshots of other modules as fixed. How do first-time users know to install the dev snapshots of these modules rather than their recommended versions in order to get translation working?

miro_dietiker’s picture

We always fix in dev an release later.

That's how issue management works here @d.o.

cpelham’s picture

I got this error out of the blue today. I then updated to the latest dev versions of Views, CTools, i18n, and Views Internationalization, ran the updater and emptied all the cache tables view phpmyadmin, and I still get the white screen of death (with this error message).

miro_dietiker’s picture

Status: Fixed » Active

Still / again active then.

Someone of the reporters will need to make this reproduceable for one of the maintainers or some other developer to reproduce the issue and fix it.

Generally i would expect, you deleted / removed / inactivated the module while it is / was still enabled as translation method in views.
There are several ideas how this could happen, most of it cannot be prevented by i18n_views. Views would need to check if the module is present while loading and provide some reasonable clean fallback (core translation method). I cannot see currently where and why this is not working.

webflo’s picture

Run in a slightly different error while exporting a view with drush into a feature.

PHP Fatal error:  Call to a member function unpack_translatables() on a non-object in /var/www/vhosts/my_project/sites/all/modules/contrib/views/plugins/views_plugin_localization.inc on line 142
PHP Stack trace:
PHP   1. {main}() /opt/drush-4/drush.php:0
PHP   2. drush_main() /opt/drush-4/drush.php:41
PHP   3. drush_dispatch() /opt/drush-4/drush.php:101
PHP   4. call_user_func_array() /opt/drush-4/includes/command.inc:214
PHP   5. drush_command() /opt/drush-4/includes/command.inc:0
PHP   6. _drush_invoke_args() /opt/drush-4/includes/command.inc:806
PHP   7. call_user_func_array() /opt/drush-4/includes/command.inc:134
PHP   8. drush_features_update() /opt/drush-4/includes/command.inc:0
PHP   9. _drush_features_export() /var/www/vhosts/my_project/sites/all/modules/contrib/features/features.drush.inc:187
PHP  10. features_export_render() /var/www/vhosts/my_project/sites/all/modules/contrib/features/features.drush.inc:258
PHP  11. features_export_render_hooks() /var/www/vhosts/my_project/sites/all/modules/contrib/features/features.export.inc:184
PHP  12. features_invoke() /var/www/vhosts/my_project/sites/all/modules/contrib/features/features.export.inc:159
PHP  13. call_user_func_array() /var/www/vhosts/my_project/sites/all/modules/contrib/features/features.module:411
PHP  14. views_view_features_export_render() /var/www/vhosts/my_project/sites/all/modules/contrib/features/features.module:0
PHP  15. ctools_component_features_export_render() /var/www/vhosts/my_project/sites/all/modules/contrib/features/includes/features.ctools.inc(24) : eval()'d code:1
PHP  16. _ctools_features_export_crud_export() /var/www/vhosts/my_project/sites/all/modules/contrib/features/includes/features.ctools.inc:184
PHP  17. ctools_export_crud_export() /var/www/vhosts/my_project/sites/all/modules/contrib/features/includes/features.ctools.inc:271
PHP  18. views_export_view() /var/www/vhosts/my_project/sites/all/modules/contrib/ctools/includes/export.inc:215
PHP  19. view->export() /var/www/vhosts/my_project/sites/all/modules/contrib/views/views.module:1552
PHP  20. view->export_locale_strings() /var/www/vhosts/my_project/sites/all/modules/contrib/views/includes/view.inc:1693
PHP  21. view->process_locale_strings() /var/www/vhosts/my_project/sites/all/modules/contrib/views/includes/view.inc:1888
PHP  22. views_plugin_localization->process_locale_strings() /var/www/vhosts/my_project/sites/all/modules/contrib/views/includes/view.inc:1899
Drush command terminated abnormally due to an unrecoverable error.                                                                                                                                                                                                 [error]
Error: Call to a member function unpack_translatables() on a non-object in /var/www/vhosts/my_project/sites/all/modules/contrib/views/plugins/views_plugin_localization.inc, line 142
webflo’s picture

Sorry my bad. A views display plugin was not enabled.

luco’s picture

@miro_dietiker I'm trying to run Views Translation on a clean install, without any views whatsoever, and still get this error.

running D7.8, Views 7.x-3.0-rc1 and Views translation 7.x-3.x-dev (2011-Sep-27).

upgrading Views to its latest DEV version fixes it for me.

selinav’s picture


lmeurs’s picture


baumer’s picture

I'm also getting this! - If I disable the Views translation module in i18n I can continue to develop but then I don't have translations for my views! Any suggestions?! About to revert to D6.

kafitz’s picture

I installed the dev versions of views, ctools and i18nviews and that solved my problem.

akalam’s picture

I think the problem is that the hook i18nviews_enable is not executed propertly.
I forced to execute this code (it is just setting a variable ) to be executed including the following code in my index.php file, just after the drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); (Drupal7):

variable_set('views_localization_plugin', 'i18nstrings');

And it worked!!

This is not a solution for the bug, is just for the people who want to make the module to works, and to give some aditional information to the bug, and to probe that the problem is in the i18nviews module, and not in views or ctools.
The people who wants to use more stable versions of views and ctools, must do it.

Don't forget to delete this line from your index.php after the first request!!

miro_dietiker’s picture

desarrollo2.0 .. Can you tell me what was in that variable before? ...

akalam’s picture

I suppose that was "core" string, just for reading the i18nviews.install file:

 * Implements hook_enable().
function i18nviews_enable() {
  // enable i18nstrings as views translation method
  variable_set('views_localization_plugin', 'i18nstrings');

 * Implements hook_disable().
function i18nviews_disable() {
  // disable i18nstrings as views translation method, switch to core
  if (i18nviews_localization_plugin_enabled()) {
    variable_set('views_localization_plugin', 'core');
miro_dietiker’s picture

desarrollo2.0, i know what it should have been...
But if it was core, it would NOT result in having a broken call.

Please try setting it back to core and recheck your reported error. I suspect you won' be able to reproduce the issue anymore.

matason’s picture

The problem (and resolution), for me at least, appeared to be i18nviews having a views api version set at 3.0 when views was 3.0-alpha1, changing i18nviews.module:106 to 'api' => '3.0-alpha1', so that includes/i18nviews.views.inc gets included worked for me.

miro_dietiker’s picture

Well... We rely on views dev, where this is set to "3.0".

We possibly should add that statement on our project front page. There are some things that where fixed in views recently that are related to the multilingual integration and there are still ongoing issues on both sides.

veleiro’s picture

I also installed the dev version of views and ctools and it fixed the issue for me

gyunei’s picture

Has anyone had any luck with the new release of Views 7.x-3.0-rc3?

webmestre’s picture

Unluncky !

clashar’s picture

I also tried out latest Views 7.x-3.0-rc3 with latest i18 7.x-1.2 and latest i18nviews 7.x-3.x-dev,
the problem is still there.

borort’s picture

The solutions #37 works for me.

- Drupal 7.8
- i18nviews 7.x-3.x-dev
- Views 7.x-3.0-rc1
- Ctools 7.x-1.0-rc1

Clear cache to make it work.

Jose Reyero’s picture

Title: Fatal error function translate() » Fatal error function translate() NEED TO CLEAR ALL CACHES
Category: bug » support
Status: Active » Fixed

So this seems to be just a caching issue. I don't think Drupal cor clears the caches after module updates which is too bad.

Anyway, if you are running a development version (like everybody here does) we are not suppossed to provide update scripts from dev to dev, that's only for point releases.

However I think: Everybody running development versions of modules should be ready to deal with these minor caching issues, or reinstalling the module if needed. And if you're not then please *wait until there's a stable version*.

These are the kind of things that are a PITA for everybody and really slow down module development distracting developers attention. So sorry if this sounds rude.

Now I am marking this as fixed because this is a NON ISSUE as this is a development version, NOT STABLE, NOT FOR PRODUCTION. Just updating issue's title so people can find it and the solution faster.

Thanks for your understanding.

Status: Fixed » Closed (fixed)

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

Kristen Pol’s picture

Title: Fatal error function translate() NEED TO CLEAR ALL CACHES » Fatal error function translate(): NEED TO CLEAR ALL CACHES and remove views_localization_plugin from variable table

In case someone is having this issue and wants to still use the development version, you can do the following (as trying to flush the cache with drush does not work and the views_localization_plugin variable must be addressed as well):

0) backup your database and your i18nviews directory (in case you want to revert later)

1) grab latest i18nviews dev version and replace old one

2) if you go to your site, you will see the "fatal error" message

3) running "drush cc all" doesn't work because it still gives you the error, so...

4) go into your database and manually clear all the cache* tables, e.g. cache, cache_views, etc.

5) disable i18nviews and views (and I had to also disable admin_menu) in the system table (set the "status" to 0 for these modules) [this step might not be necessary but it won't hurt]

6) delete the "views_localization_plugin" variable from the variable table

7) go to site, should come up now

8) now enable views and i18nviews (and admin_menu if necessary) and you should be okay

9) run update.php if necessary (if using newer versions of modules)

Good luck,

kris_mcl’s picture

Hi, just a quick note for anyone who stumbles on this. I was getting the exact same error with version 6.x-2.0 after cloning my site to a new server. The steps in #46 fixed the problem for me even though I skipped steps 5, 8 & 9.

funature’s picture

i did it like #46, but still can not find the views filter for content negotiation, like http://drupal.stackexchange.com/questions/7644/views-with-multiple-langu...

travis-cunningham’s picture

#46 worked for me. Thanks for the steps!

travis-cunningham’s picture

Issue summary: View changes

Add in link to instructions on how to fix