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.
I have the same problem here. I thought that the fix on http://drupal.org/node/1252018 would fix it but unfortunately not.
I have created this patch for views_plugin_localization.inc, which I am using.
Please test.
+++ b/plugins/views_plugin_localization.incundefined
@@ -136,30 +136,33 @@ class views_plugin_localization extends views_plugin {
+ if (!empty($this->view) && !empty($this->view->localization_plugin) && method_exists($this->view, 'is_translatable')) {
What about if (!isset($this->view) || !($view instance View) || empty($this->view->localization_plugin)) and if that fails return and do nothing. This would really help to make the change as small as possible as well as keep it more readable.
Bumping to major as I can't even save a new view without this patch.
Attached patch looks bigger than it is. The biggest changes are that the init_localization() function now always returns the translate attribute from the localization plugin. If this attribute is not set, the plugin is loaded up and inited. This is true even for the views_plugin_localization_none plugin, whereas before, if that plugin was being used, it was not being inited. In addition, one other bug in the previous function is that if the localization plugin existed on the object, localization would be attempted even if the translate property was set to FALSE. So, the reason for the bug was two-fold:
The views_plugin_localization_none plugin was not being inited (and therefore $this->view was not set).
The init_localization() function returned TRUE for all localization plugins (once they had been set on the view), regardless if the translate attribute was set to FALSE on the plugin.
Same problem here. I only needed i18nviews to translate my exposed filters, the site already had a lot of translated views using core.
So I set the translation plugin to core after installing i18nviews, but I do use the (translated) filters.
Setting up and featuring was no problem, but when running install profile I got above error.
After playing with my localization settings I had the same problem with Views 7.x-3.8 module:
After saving a view, I had the PHP error "Call to a member function init_display() on a non-object in modules/all/views/plugins/views_plugin_localization.inc".
To fix the problem like dawehner (#1) said:
- Views > Settings > Advanced (admin/structure/views/settings/advanced)
- In Localization > Translation method: Check the radio button "None"
- Save configuration
#9 works for me. I had been trying to save views, but each time I clicked Save I was getting the WSOD. Thanks q0rban!
#14 didn't make any difference unfortunately.
Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.
Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.
Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)
Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)
Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)
Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)
Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.
Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.
After the nudge from larowlan I did some digging ....
This issue was committed to Views for Drupal 7 version 7.x-3.x-dev on 23 December 2015. It was then moved to Drupal core for back porting. However, Views was already merged into core, that happened on Oct 22, 2012 #1805996: [META] Views in Drupal Core. Furthermore, this particular issue is making changes to the localization plugin which was removed from Views (for Drupal 7) 8.x-3.x-dev on Sep 8 2012 in #1754322: Remove export and localization code before the merge. This patch is not relevant to Drupal 8+.
I think the changes in #29 should be revert, that is, this goes back to Views for Drupal 7 version 7.x-3.x-dev, with a status of 'Fixed';.
Comments
Comment #1
dawehnerYou might have to switch the localization backend to none/core again, which can be done under the advanced settings of views.
Comment #2
dawehnerUpdate status, whether you updated the value.
Comment #3
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedit is set to none
Comment #4
marcelovaniI have the same problem here. I thought that the fix on http://drupal.org/node/1252018 would fix it but unfortunately not.
I have created this patch for views_plugin_localization.inc, which I am using.
Please test.
Comment #5
kolyapatrik CreditAttribution: kolyapatrik commentedThanks marcelovani. It work with this patch
Comment #6
dawehnerThank you for working on this particular problem!
What about if (!isset($this->view) || !($view instance View) || empty($this->view->localization_plugin)) and if that fails return and do nothing. This would really help to make the change as small as possible as well as keep it more readable.
Comment #7
marcelovani@dawehner sure thing, here is the patch.
Comment #8
q0rban CreditAttribution: q0rban commentedI don't think this is solving the real problem. For some reason, the localization plugin is being added to the view without actually getting init()ed.
Comment #9
q0rban CreditAttribution: q0rban commentedBumping to major as I can't even save a new view without this patch.
Attached patch looks bigger than it is. The biggest changes are that the init_localization() function now always returns the translate attribute from the localization plugin. If this attribute is not set, the plugin is loaded up and inited. This is true even for the views_plugin_localization_none plugin, whereas before, if that plugin was being used, it was not being inited. In addition, one other bug in the previous function is that if the localization plugin existed on the object, localization would be attempted even if the translate property was set to FALSE. So, the reason for the bug was two-fold:
Comment #10
mex30 CreditAttribution: mex30 commentedHi,
How should I use this patch?
I'm not very good to use Drupal.
Comment #11
mex30 CreditAttribution: mex30 commentedComment #12
betarobot CreditAttribution: betarobot commentedHare is a brief tutorial on applying patches: https://drupal.org/patch/apply
Comment #13
HnLn CreditAttribution: HnLn commentedSame problem here. I only needed i18nviews to translate my exposed filters, the site already had a lot of translated views using core.
So I set the translation plugin to core after installing i18nviews, but I do use the (translated) filters.
Setting up and featuring was no problem, but when running install profile I got above error.
Patch in #9 fixes it for me.
Also had to patch i18nviews with https://drupal.org/comment/6467022#comment-6467022.
Comment #14
FR6 CreditAttribution: FR6 commentedAfter playing with my localization settings I had the same problem with Views 7.x-3.8 module:
After saving a view, I had the PHP error "Call to a member function init_display() on a non-object in modules/all/views/plugins/views_plugin_localization.inc".
To fix the problem like dawehner (#1) said:
- Views > Settings > Advanced (admin/structure/views/settings/advanced)
- In Localization > Translation method: Check the radio button "None"
- Save configuration
Comment #15
Tom Verhaeghe CreditAttribution: Tom Verhaeghe commentedI had the same problem. Patched with #9 and it now works like a charm. Changing the settings as mentioned in #14 did not fix it for me.
Comment #16
wroxbox CreditAttribution: wroxbox commentedPatch #9 works for us too. Would like to change the status "RTBC"
Comment #19
bluesman2014 CreditAttribution: bluesman2014 commented#9 works for me. I had been trying to save views, but each time I clicked Save I was getting the WSOD. Thanks q0rban!
#14 didn't make any difference unfortunately.
Comment #21
marcelovaniWhat is the current situation with this issue?
Comment #22
thtas CreditAttribution: thtas commentedI've had good success with patch from #9
looks like the patch was postponed by the testbot. Can we re-queue it?
Comment #23
ptmkenny CreditAttribution: ptmkenny commentedRe-uploading the patch in #9 because according to an IRC discussion with timplunkett the legacy testbots no longer exist.
Comment #24
Dane Powell CreditAttribution: Dane Powell at Acquia commented#23 works for us.
Comment #25
Orkut Murat Yılmaz#23 solved our problem too:)
Comment #26
Rockay CreditAttribution: Rockay commentedAwesome! #9 patch saved me big time.
Been at the same issue with views in D7.
Comment #27
mvcPatch #23 worked for me too.
Comment #29
colanThanks for the "git am"-able patch!
Comment #32
catchComment #41
quietone CreditAttribution: quietone at PreviousNext commentedAfter the nudge from larowlan I did some digging ....
This issue was committed to Views for Drupal 7 version 7.x-3.x-dev on 23 December 2015. It was then moved to Drupal core for back porting. However, Views was already merged into core, that happened on Oct 22, 2012 #1805996: [META] Views in Drupal Core. Furthermore, this particular issue is making changes to the localization plugin which was removed from Views (for Drupal 7) 8.x-3.x-dev on Sep 8 2012 in #1754322: Remove export and localization code before the merge. This patch is not relevant to Drupal 8+.
I think the changes in #29 should be revert, that is, this goes back to Views for Drupal 7 version 7.x-3.x-dev, with a status of 'Fixed';.
Comment #42
quietone CreditAttribution: quietone at PreviousNext commentedlarowlan has confirmed my finding so I am making the changes to the meta data.