When upgrading to the latest beta 6.0, meta set with context generate this error :

Notice : Undefined index: instance in DrupalTextMetaTag->getValue()

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

Component: Code » Context

Oopsie. I'll do some testing with metatag:context next.

Allthegearnoidea’s picture

Hi

Same issue for me.

Thanks

Jawi’s picture

same issue here after update:

Notice: Undefined index: instance in DrupalTextMetaTag->getValue() ....

krima’s picture

I have the same problem:
Notice: Undefined index: instance in DrupalTextMetaTag->getValue() (line 97 ..../sites/all/modules/metatag/metatag.inc).

StuddMan’s picture

Same thing, just updated to Beta6 for the node:summary fix and getting the following error on any pages using context with the Meta Data reaction.

Notice: Undefined index: instance in DrupalTextMetaTag->getValue() (line 97 of .../modules/metatag/metatag.inc)

fchandler’s picture

Same here
Notice: Undefined index: instance in DrupalTextMetaTag->getValue() (line 97 of .../sites/all/modules/metatag/metatag.inc).

lines 96 and 97 of metatag.inc

  public function getValue(array $options = array()) {
    $name = "metatag:" . $options["instance"] . ":" . $this->info["name"];

if that helps

It happens when I click on the "Home" page (a page designated as the front), but not on other pages of the site. It does not do it on my dev site, unfortunately it does on the live site.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
1.31 KB

This should fix it - all it took was moving the $instance assignment around and adding that value to the $options.

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed.

Jawi’s picture

The latest dev version fixed this issue.

http://ftp.drupal.org/files/projects/metatag-7.x-1.x-dev.tar.gz of 2013-Apr-17

Thanks for the support!

DamienMcKenna’s picture

Status: Fixed » Closed (fixed)

Now that v7.x-1.0-beta7 is out, I'm closing this in the interest of keeping the issue queue clean.

Allthegearnoidea’s picture

Thanks for your support with this.

Unfortunately for me the notice still remains even after upgrading to the v7.x-1.0-beta7

jaimecarrion’s picture

Version: 7.x-1.0-beta6 » 7.x-1.0-beta7
Status: Closed (fixed) » Active

Actually I got this error when I updated my install to v7.x-1.0-beta7.

Jorrit’s picture

Status: Active » Needs review
FileSize
2 KB

A similar change as #7 needs to be applied to metatag_panels_ctools_render_alter() in metatag_panels.module, line 88, see the attached patch.

In any case, the definition of DrupalTextMetaTag->getValue() is erroneous. The $options parameter has default value array(), which will generate the notice.

LaurenW’s picture

I am seeing the same error with the update to 7.x-1.0-beta7. Sorry to ask a stupid question, but can someone point me in the direction of a tutorial explaining how to apply the above patch?

Thanks!

Jibus’s picture

You can follow these instructions : http://drupal.org/patch/apply

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed. Thanks Jorrit.

Jorrit’s picture

Thanks for the commit and git attribution!

DamienMcKenna’s picture

@Jorrit: FYI I've opened a new issue for the general problem with DrupalTextMetaTag::getValue(): #1994634: DrupalTextMetaTag::getValue() defaults to not having $options['instance'] but expects it

LaurenW’s picture

[Reply to #15]
I am not a backend developer and the instructions on that page don't really make sense to me. Is there a way to apply this patch without using command line, just FTP and CPanel access to my site? I did find some beginner instructions here http://drupal.org/node/620014 but they are for Windows and I am on a Mac.

Thanks for your help!

DamienMcKenna’s picture

@LaurenW: All you have to do is download the current -dev version, that includes the fixes.

Countzero’s picture

Status: Fixed » Needs work

Still having the issue with latest dev and latest core : as soon as I set the metatag option on any panel variant, the errors appear.

And the more info I type (title, abstract, etc.) the more notices I get.

No value is set in the META either.

kingfisher64’s picture

I'm getting quite a few of these notices with beta7. Tried the latest dev and the errors disappear. Would it be possible to have this as beta8 release as it reads +27 version.

Thank you.

ehalber’s picture

I am still experiencing the notices also. I have updated to the latest dev version. Any ideas?

EDIT: NM, I downloaded the dev to the wrong directory. I discovered my error when I was reviewing the modules page. Now it's up to 7.x-1.0-beta7+45-dev. That fixed it.

MustangGB’s picture

Version: 7.x-1.0-beta7 » 7.x-1.x-dev
Status: Needs work » Fixed

This is fixed in the latest dev.

Status: Fixed » Closed (fixed)

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

pinkonomy’s picture

The latest dev version removed this notice also for me :)