Following PHP notice with Metatag 7.x-.125 occurred on my site:

Notice: Undefined index: value in DrupalTextMetaTag->getValue() (line 486 of metatag/metatag.inc)

Notice: Undefined index: value in metatag_panels_ctools_render_alter() (line 215 of metatag/metatag_panels/metatag_panels.module)

Is there anyone know how to fix this?

Thanks,

Comments

Mingsong created an issue. See original summary.

Snehal Brahmbhatt’s picture

Status: Active » Needs review
StatusFileSize
new1.23 KB

@Mingsong, Please review my patch may this works for you.

damienmckenna’s picture

Do you have any idea what meta tag was causing the problem?

mingsong’s picture

#2 works to me.

Thanks Snehal

mingsong’s picture

Status: Needs review » Fixed
damienmckenna’s picture

Version: 7.x-1.25 » 7.x-1.x-dev
Status: Fixed » Needs review

Please don't mark an issue "fixed" if there's a bug report and someone provides a patch. Thanks for mentioning that the patch fixes the bug, that's good to know. I'd love to work out what meta tag is causing the problem, or failing that, a comparison with the other parts of the module suite to see if they might be affected by the same problem.

damienmckenna’s picture

StatusFileSize
new1.66 KB
new1.37 KB

The code in getValue() would result in notices if $this->data['value'] didn't exist because then for the rest of the function $value doesn't exist. I think it'd be better to do it this way. Also, there was another case of it doing is_string() without also checking that the variable existed.

damienmckenna’s picture

  • DamienMcKenna committed 447f274 on 7.x-1.x
    Issue #2982252 by DamienMcKenna, dev20.addweb, Mingsong: PHP Notice:...
damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thanks.

Status: Fixed » Closed (fixed)

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