Closed (fixed)
Project:
Metatag
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Jul 2013 at 17:27 UTC
Updated:
14 Jul 2014 at 01:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
cha0s commentedI did some more testing, and apparently when no metatags exist, the metatags array is not keyed by language, so instead of doing isset() we need to check !empty(). New patch reflects this approach.
Comment #2
illeace commentedComment #3
illeace commentedI tested the patch and it fixed the issue. I found another issue when using metatag tokens in text area fields (like the node body).
Update:
The issue isn't actually related to text area fields at all. The problem is that it's easy to create an infinite loop when using metatag tokens. I'll create a new issue to explain the problem in more detail.
Comment #4
illeace commentedNevermind, I was testing the wrong patch. The problem below is exactly the reason for the second patch.
After some further testing, I've come across a case that this patch doesn't handle. Use the same steps to reproduce from above, but this time in your custom text field enter the token "[node:metatag:keywords]". Make sure the the metatag keywords field is empty. When you save and view the node you should get the error "Fatal error: Unsupported operand types" in the metatag.tokens.inc file. This is because the $entity->metatags array exists, but is empty. This results in $metatags being null, resulting in an error in this linebecause it's trying to get the union of a null value and an array.Comment #5
illeace commentedComment #6
damienmckennaComment #7
pingwin4eg2 @illeace: If all good you should have returned RTBC status.
I confirm that patch from #1 works.
Comment #8
damienmckennaDoes this also resolve the same problem?
Comment #9
pingwin4egOk, even better checking. Maybe then let it be
for the same reason as #1?
Comment #10
damienmckennaEt voila.
Comment #11
pingwin4egPerfect! :)
Comment #12
damienmckennaCommitted! Thanks for your help.