I get this error:

Notice: Undefined variable: keys in metatags_quick_page_build() (line 187 of /-/.....PATH_TO_SITE....../sites/all/modules/metatags_quick/metatags_quick.module).

When viewing a Panel page with a View inside .....

Any idea?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moonpool’s picture

I get the same with the alpha-3 release

JOINSO’s picture

There is no problem with another Panel Pages.
In my case the problem is in a Panel Page with a View block inside...
Is your case?

Regards!

JOINSO’s picture

Hi!

I just make some debuggin on the module and i find this.

$keys is never defined in Panel Pages (almost in my case).

And why some Panel Pages works and others no?

The problem is that function:

_metatags_quick_fieldable that returns an array in some Panel Pages and a empty one in anothers....

When return the empty one everything goes fine, but not when returns with the type...., because found after the problem with $key....

I'm going to continue studying to find the underlying problem....

Regards!

JOINSO’s picture

Hi!.....

When i'm debugging i see a special behaviour:

In the case of a Panel Page with a View block inside, the function
_metatags_quick_fieldable is called first with type "node". In this case we see the error of the issue....

In a Panel Page without a View block inside...., _metatags_quick_fieldable is never called with type "node" ....

Any idea?

Regards!

john.oltman’s picture

I get this in both alpha3 and dev, immediately after installing the module into a fresh 7.2 site. It appears at the top of the module list page. I've not defined any meta tag fields yet, just enabled the module and got the notice.

JOINSO’s picture

I think that the problem is in Views, exactly with this function:
$keys = array_keys($router_item['load_functions']);

Where is any page with views inside, the module are called more than one time.... at least one for the page and another for the view.... and the fails....

Regards!

valthebald’s picture

Status: Active » Needs review
FileSize
524 bytes

I wanted to include that with other changes to the next release, but seems there are too many problems with this issue.

In metatags_quick_page_build() function menu object must be loaded, only if current page is an entity view page
(which is not the case).
Please use attached patch (or change line 185 from

if (!$fieldable_entity) {

to

if ($object_loadable && !$fieldable_entity) {

john.oltman’s picture

Status: Needs review » Reviewed & tested by the community

#7 worked for me, thanks much

JOINSO’s picture

Hi!
THis patch only avoids the problem....
But in this cases, the meta tags doesn't show.....

Regards!

amanaplan’s picture

subscribing

valthebald’s picture

Version: 7.x-2.x-dev » 7.x-2.0-alpha4
Assigned: Unassigned » valthebald
Status: Reviewed & tested by the community » Fixed
JOINSO’s picture

Status: Fixed » Active

Hi, valthebald....

I'ts not fixed, in that cases when the error is present (keys not defined), meta tags are not showed.

Regards!

valthebald’s picture

In alpha4 there is no 'keys' check. On what line do you get an error?

JOINSO’s picture

In normal Panel pages, meta tags works normal, but when i have a Panel Page, with a View block inside, then it seems that the module tries to check meta tags for the view..... in this case, meta tags are not showed.

Here is the page that doesn't work: http://beta.bicisprint.com/es/club/noticias/
and here one that works: http://beta.bicisprint.com/es/club/

Regards!

valthebald’s picture

Status: Active » Postponed (maintainer needs more info)

I've tried to do the same - views block inside panels page. Worked fine.
Need more info, could not reproduce

moonpool’s picture

alpha-4 has fixed this for me

JOINSO’s picture

Ok, tomorrow i will try alpha-4 and make some tests.
Regards!

JOINSO’s picture

Doesn't work alpha-4

This works: http://beta.bicisprint.com/club/

and this doesn't work:

http://beta.bicisprint.com/es/club/noticias/

Regards!

valthebald’s picture

Version: 7.x-2.0-alpha4 » 7.x-2.x-dev
Status: Postponed (maintainer needs more info) » Active

Ok, I managed to reproduce the problem. Most chance it comes from double URL-escaping of the path ('club/noticias') - first it is transformed to club%2Fnoticias, and then to club%25252noticias.
This is a definite bug, patch coming later

JOINSO’s picture

Thanks, valthebald!
We wait for the patch!
Regards!

valthebald’s picture

Title: Undefined variable: keys in metatags_quick_page_build() » Incorrect handling of multi-part paths
Status: Active » Fixed
Issue tags: +Path based meta tags
FileSize
4.38 KB
JOINSO’s picture

Hi, valthebald!
The patch doesn't work for me.

When i'm on the Panel Page, i see "Meta Tags (quick) settings" link, and when i click i go to Config for Meta tags, no to edit the meta tags of the Panel Page....

Regards!

valthebald’s picture

You absolutely need to clean drupal cache after applying the patch. "Meta Tags (quick) settings" link means that menu system does not see (updated) menu handlers

JOINSO’s picture

Hi!
It seems to works!
Thanks!

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