When the module is installed, no node has additional meta information in the opengraph_meta tag. The fallback image is loaded very early in get_og_tag_defaults() and it is not overwritten by load_node_data() when there is no row. Later on, in render_data(), the code is not able to detect that the fallback image should be overwritten by the image loaded from the node because it is unable to distinguish between images loaded from the opengraph_meta row and the default image. This problem exists both in 6.x and 7.x.

Comments

Jorrit’s picture

Assigned: Jorrit » Unassigned
Status: Active » Needs review
StatusFileSize
new3.06 KB
new3.08 KB

I have moved the call to retrieve the fallback image to a point where it is executed at a later point in the page load cycle. The patches for D7 and D6 are similar. I have uploaded two patches, but I think it is possible to apply the D7 patch and merge it to the D6 branch. I have also included a test that fails when the common.inc file is not patched.

sixelats’s picture

patching 6.x-1.5 with d6.patch fails with:

patching file a/opengraph_meta.common.inc
Hunk #1 succeeded at 119 (offset -1 lines).
Hunk #2 FAILED at 139.
1 out of 2 hunks FAILED -- saving rejects to file a/opengraph_meta.common.inc.rej
patching file a/tests/Basic.test
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 151 with fuzz 1.

patching 6.x-1.x-dev of 26 Nov 2011 with d6.patch results:

patching file a/opengraph_meta.common.inc
Hunk #1 succeeded at 126 (offset 6 lines).
Hunk #2 succeeded at 146 (offset 6 lines).
patching file a/tests/Basic.test
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 228 with fuzz 1 (offset 77 lines).

patching 6.x-1.5 with d7.patch results:

patching file a/opengraph_meta.common.inc
Hunk #2 succeeded at 125 with fuzz 2 (offset -1 lines).
patching file a/tests/Basic.test
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 151 with fuzz 1.

I've used the files from the last patching attempt mentioned above and they seem to work. Didn't try the patched dev version because the unpatched version gave me errors.

Jorrit’s picture

I'll try to reroll the patches later.

Jorrit’s picture

StatusFileSize
new3.3 KB

You can apply the attached patch to 6.x-1.x-dev.

hiddentao’s picture

Status: Needs review » Fixed

Fixed in dev, for both 6.x and 7.x. Thanks for the patch.

Status: Fixed » Closed (fixed)

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