after installation I receive:

Recoverable fatal error: Argument 2 passed to metatag_metatags_view() must be an array, null given, called in /home4//public_html//sites/all/modules/metatag/metatag_views/metatag_views.module on line 97 and defined in metatag_metatags_view() (line 1005 of /home4//public_html//sites/all/modules/metatag/metatag.module).

Comments

das-peter’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new584 bytes

I think the code there should be a bit more defensive.
What about attached patch?

FuXXz’s picture

It seems to run.
One line broke the whole Page? Cron, clear cache, pathauto..all broken :(
Did they not test any stable releases? This isnt stable

matthieu_collet’s picture

we have a lot of problems, last dev version was better.

I don't have metatag access in the views, the options disapears

Metatag VIews isn't working anymore, no specific tags for all views, and no more for specific views...

do you have the same problem ?

crozilla’s picture

Same problem here: Recoverable fatal error: Argument 2 passed to metatag_metatags_view() must be of the type array, null given...

jedsaet’s picture

#1 fixed the error for me. +1RTBC.

ofry’s picture

Status: Needs review » Reviewed & tested by the community
agoradesign’s picture

+1RTBC

pkiff’s picture

Thanks for the quick patch, das-peter! Had a minor crisis this morning when several sites broke after what appeared to be a routine update. Patch in #1 works for me too.

mikelutz’s picture

#1 works for me. Hopefully a update will be release soon.

howdytom’s picture

version 7.x-1.2 breaks our webpages too.

Recoverable fatal error: Argument 2 passed to metatag_metatags_view() must be of the type array, null given, called in /path/sites/all/modules/metatag/metatag_views/metatag_views.module on line 97 and defined in metatag_metatags_view() (Zeile 1005 von /path/sites/all/modules/metatag/metatag.module).

lias’s picture

Ditto fatal error with update to 7x1.2

Recoverable fatal error: Argument 2 passed to metatag_metatags_view() must be an array, null given, called in path\sites\all\modules\metatag\metatag_views\metatag_views.module on line 97 and defined in metatag_metatags_view() (line 1005 of path\sites\all\modules\metatag\metatag.module).

Quick fix for me was to uninstall metatag views with this version.

CarmyDesign’s picture

Worked for me.

AmeDSL’s picture

#1 works for me

damienmckenna’s picture

Priority: Normal » Critical
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new687 bytes

First off, I'm really sorry about not testing pages that did not contain meta tags. I'm making this a critical issue and I'll have 1.3 out either today or tomorrow.

I'm going to go with this approach instead of the original as it allows the default "views" meta tags to be loaded if none have been assigned for the current page's view.

damienmckenna’s picture

damienmckenna’s picture

biigniick’s picture

Status: Needs review » Reviewed & tested by the community

same issue happened to me this morning. #14 patched and fixed v7.x-1.2 and dev just fine for me. as long as the test comes back ok, i think we're RBTC

- nick

pkiff’s picture

I tested the patch in #14 against same two sites that I patched this morning using #1, and #14 seems to work just as well in my cases.

das-peter’s picture

@DamienMcKenna Definitely the better approach! I should have checked the behaviour of metatag_metatags_view() in detail before patching.

I've a question regarding the condition:

+++ b/metatag_views/metatag_views.module
@@ -82,6 +82,10 @@ function metatag_views_page_alter(&$page) {
+    if (!is_array($metatags) || empty($metatags)) {

Do we need the || empty($metatags) part?
Everything that isn't an array is set to array().
And if it's an array but empty (which means it's array(), right?) we set to array().

kgaut’s picture

Hi,

Same probleme here, patched successfully with #14.

Cheers

damienmckenna’s picture

@das-peter: It may be overly cautious to use both http://php.net/is_array">is_array() and empty(), but in the interest of ensuring I don't break something else later ;) I felt it's better to ensure the string is an array. And no, empty() isn't just for arrays.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

  • DamienMcKenna committed b097388 on 7.x-1.x
    Issue #2350967 by das-peter, DamienMcKenna: Fatal error occurred loading...
damienmckenna’s picture

jaylotta’s picture

Is it possible to pull the release.

mloveridge17’s picture

I updated my dev site with the patch and Views pages are no longer throwing the fatal error. But I'm not seeing anywhere on the Views UI to set Meta tags. The Page Settings section has just Path, Menu, & Access options. Can anyone point me to where I need to go to set a canonical for a Views page?

pkiff’s picture

@mloveridge17

Can anyone point me to where I need to go to set a canonical for a Views page?

Make sure that you have the Metatag: Views sub-module enabled as well as the main Metatag module. When the sub-module is enabled, you should see a new "Meta Tags" section appear in a View, typically at the bottom of the middle column (the same column where you find the "Page Settings" section at the top).

matthieu_collet’s picture

As @mloveridge17 I do'nt have Metatag options in views anymore, except for one or two views...

there is still bugs to fix :(

mloveridge17’s picture

@pkiff
First, thanks for responding so quickly!

Make sure that you have the Metatag: Views sub-module enabled as well as the main Metatag module.

Done... both enabled.

When the sub-module is enabled, you should see a new "Meta Tags" section appear in a View, typically at the bottom of the middle column (the same column where you find the "Page Settings" section at the top).

Nope... nothing new. In the middle column, I get the following:
PAGE SETTINGS (with Path, Menu, & Access), HEADER, FOOTER, & PAGER (with Use Pager & More Link).

I tried adding the patch to the metatags_views_plugin_display_extender_metatags.inc file found at https://www.drupal.org/node/2289139 but that didn't enable the metatags on the display as hoped.

pkiff’s picture

Mmmm...it seems like you and matthieu_collet are right, there is still a bug in this. I have no idea what is going on, but for whoever is troubleshooting this, I seem also to have the problem described by mloveridge17 in #26 above and by matthieu_collet in #28.

On my two installations, only views that had overridden the default Metatag setting are showing the Meta Tags section. Pre-existing views with no custom meta tags set, or newly created page views, do not show the Meta Tags options. This appears to be the case for sites using both the patch in #1 and the patch in #14.

I think if someone else can confirm this bug, then we should move this back to status Needs work.

plazik’s picture

Status: Fixed » Needs work

I don't have Metatag option in Views only if there are default metatags.

mloveridge17’s picture

It seems to me that the main topic of this thread has actually been fixed in that the module is no longer throwing the Fatal Error that was reported, but we now have uncovered a new bug which probably warrants its own thread? I'm far from an admin here, but I think moving these to a new thread would give this issue the visibility and attention it needs?

Oh, and I updated to 7x-1.3 and still no Metatag options on my Views UI... :(

Leeteq’s picture

Status: Needs work » Fixed
damienmckenna’s picture

Please take a look at the patch I posted in #2353079: not seeing anywhere on the Views UI to set Meta tags and let me know if it works. Thanks.

Status: Fixed » Closed (fixed)

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