Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
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
Update
This can be addressed following the instructions here: http://drupal.org/node/1251706#comment-5628680
Comments
Comment #1
irishdan CreditAttribution: irishdan commentedanybody else have this problem?
Comment #2
aimevpHi,
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...
Grtzzzz,
Hatznie.
Comment #3
tempo22 CreditAttribution: tempo22 commentedi 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
Comment #4
irishdan CreditAttribution: irishdan commentedAfter 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"?
cheers
dan
Comment #5
cloporto CreditAttribution: cloporto commentedHi, I am having exactly the same problem!!
Did you find a solution?
Thanks!
Comment #6
aimevp@Tempo22: I've looked how the setting was set in my website and it was already set on "core". Still having the error though.
Comment #7
miro_dietikerAs 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...)
Comment #8
irishdan CreditAttribution: irishdan commentedIf 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.
Comment #9
webflo CreditAttribution: webflo commentedDownload 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.
Comment #10
miro_dietikerA 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? :-)
Hmm...
Comment #11
irishdan CreditAttribution: irishdan commentedI 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?
Comment #12
webflo CreditAttribution: webflo commentedNo. Latest dev. git checkout.
Comment #13
czigor CreditAttribution: czigor commentedI'm getting the same. I have views rc1 and ctools rc1. Clearing the cache also gets stuck with this error.
Comment #14
webflo CreditAttribution: webflo commentedCan you provide a backtrace?
Comment #15
czigor CreditAttribution: czigor commentedUpdating views and ctools to latest dev solved for me.
Comment #16
miro_dietikerDuplicated by
#1253898: Fatal error: Call to a member function translate() on a non-object
Comment #17
alauzon CreditAttribution: alauzon commentedThanks czigor, I installed latest dev for views and ctools and that fixed it for me.
Comment #18
czigor CreditAttribution: czigor commentedThen lets mark this fixed
Comment #19
marktheshark CreditAttribution: marktheshark commentedHas 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.
Comment #20
dc-hokie CreditAttribution: dc-hokie commentedI 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.
Comment #21
marktheshark CreditAttribution: marktheshark commentedTried 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.
Comment #22
sfyn CreditAttribution: sfyn commentedI 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?
Comment #23
miro_dietikerWe always fix in dev an release later.
That's how issue management works here @d.o.
Comment #24
cpelham CreditAttribution: cpelham commentedI 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).
Comment #25
miro_dietikerStill / 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.
Comment #26
webflo CreditAttribution: webflo commentedRun in a slightly different error while exporting a view with drush into a feature.
Comment #27
webflo CreditAttribution: webflo commentedSorry my bad. A views display plugin was not enabled.
Comment #28
luco CreditAttribution: luco commented@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.
Comment #29
selinav CreditAttribution: selinav commented+1
Comment #30
lmeurs CreditAttribution: lmeurs commented+1
Comment #31
baumer CreditAttribution: baumer commentedI'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.
Comment #32
kafitz CreditAttribution: kafitz commentedI installed the dev versions of views, ctools and i18nviews and that solved my problem.
Comment #33
akalam CreditAttribution: akalam commentedI 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):
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!!
Comment #34
miro_dietikerdesarrollo2.0 .. Can you tell me what was in that variable before? ...
Comment #35
akalam CreditAttribution: akalam commentedI suppose that was "core" string, just for reading the i18nviews.install file:
Comment #36
miro_dietikerdesarrollo2.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.
Comment #37
matason CreditAttribution: matason commentedThe 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.
Comment #38
miro_dietikerWell... 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.
Comment #39
veleiro CreditAttribution: veleiro commentedI also installed the dev version of views and ctools and it fixed the issue for me
Comment #40
gyunei CreditAttribution: gyunei commentedHas anyone had any luck with the new release of Views 7.x-3.0-rc3?
Comment #41
webmestre CreditAttribution: webmestre commentedUnluncky !
Comment #42
clashar CreditAttribution: clashar commentedI 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.
Comment #43
borort CreditAttribution: borort commentedThe 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.
Comment #44
Jose Reyero CreditAttribution: Jose Reyero commentedSo 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.
Comment #46
Kristen PolIn 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,
Kristen
Comment #47
kris_mcl CreditAttribution: kris_mcl commentedHi, 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.
Thanks!
Comment #48
funature CreditAttribution: funature commentedi 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...
Comment #49
travis-cunningham CreditAttribution: travis-cunningham commented#46 worked for me. Thanks for the steps!
Comment #49.0
travis-cunningham CreditAttribution: travis-cunningham commentedAdd in link to instructions on how to fix