I have no problems with the images embedded within the body's code, but images from Image fields don't get the correct path. More precisely, they have the relative path which doesn't work if you have public filesystem mode and language prefixes. For example I get http://www.example.com/en/public/etc.png instead of http://www.example.com/public/etc.png -- it goes without saying the first one triggers a 404 while the second one works.

See attachment.

Comments

hiddentao’s picture

Status: Active » Postponed (maintainer needs more info)

Is this still an issue?

el_reverend’s picture

Version: 6.x-1.x-dev » 6.x-1.5
Status: Postponed (maintainer needs more info) » Active
Issue tags: +display, +CCK, +module, +error, +image, +path, +images
StatusFileSize
new37.07 KB
new11.89 KB

Hello Hiddentao,

Yes, it is. I am using a custom CCK image field and in-body images in my nodes. The image used in the CCK field is properly seen by the module, however the images listed in the body of the node are not.

Looking at the HTML source it renders the img tag like this:

<img src="//sites/files/defaults/path/to/image.jpg" alt="/sites/files/defaults/path/to/image.jpg" title="/sites/files/defaults/path/to/image.jpg" width="32px" height="32px">

It seems to be related to the img tag in the opengraph_meta on one line 119. Why is the $path recorded differently than $abs_path used in the beginning of the img tag?

After a bit of trial and error it seems that the in-body images load after altering the line like this:

// Line 119 of opengraph_meta.module
OLD: 
$image_selector_options[$path] = "<img src=\"$abs_path\" alt=\"$path\" title=\"$path\" width=\"32px\" height=\"32px\" />";
NEW:
$image_selector_options[$path] = "<img src=\"$path\" alt=\"$path\" title=\"$path\" width=\"32px\" height=\"32px\" />";

BUT does not load the image referenced in the CCK imagefield now since it's missing a part of it's URL (see attached images).

Can we process the URL and remove the leading '\' and add that as needed to the actual img tag?

timmetj’s picture

I also found this problem..

In my case it worked on a multilanguage website using domains.. But now it doesnt seem to work on multilang website using Prefix..
So when you go and look in the HEAD of the source, you'll see something like:
meta content="http://website/nl/sites/default/files/image.png" property="og:image">

And it should be:
meta content="http://website/sites/default/files/image.png" property="og:image">

It may not add the language prefix in its src..

Also in the node edit itself (like mentioned above) the image src also shows "nl/sites/default/files/image.png" instead of "(/)sites/default/files/image.png".
But has this something to do with the language plugin? Cause i use this same module on another site with domain switching instead of prefix, and there the image src shows the full url, not the path: "http://website/sites/default/files/image.png" And on this other site then, it only shows the path.

maciej.zgadzaj’s picture

StatusFileSize
new247 bytes

I had similar problems as well.

What fixed it for me, and so far seems to be working well, is adding call to file_create_url() in _extract_image_fields_from_node() in opengraph_meta.common.inc.

Diff attached.

hiddentao’s picture

Thanks for the patch. Will take a look at this.

pribeh’s picture

The patch in #4 doesn't seem to resolve the issue for me.

maciej.zgadzaj’s picture

@pribeh - perhaps. By no means I wanted to say that this is panacea for the issue in question. I had one very specific problem in one very specific place (which seemed to be at least very similar) and this patch resolved it for me. I have not conducted though any extensive testing using different installs/scenarios to be able to say that this is an ultimate fix. Just decided to share my solution in case it would work for someone else too.

pribeh’s picture

#maciej.zgadzai, I still thank you for your efforts. I just wanted to report that it did not resolve my issues in regards to CCK imagefields not being picked up. I'm noticing that it is picking up some of them but only of course after I choose which image for it to pick up and then only some of the time. The website in question that I have open graph tags installed and setup on is here: http://londonfuse.ca/

weri’s picture

StatusFileSize
new816 bytes

The description #3 describes the problem correctly. On multilingual sites, the language prefix is added with the url() function. Instead the function file_create_url() should be used. See the attached patch.

hiddentao’s picture

Does the patch in #9 by @weri work for people?

claudiu.cristea’s picture

Status: Active » Reviewed & tested by the community

#9 works as expected. RTBC!

claudiu.cristea’s picture

#1332154: Thumbnail and i18n is duplicating this.

maciej.zgadzaj’s picture

Version: 6.x-1.5 » 6.x-1.7
Status: Reviewed & tested by the community » Needs review

Attached patch for version 1.7. (Hopefully no-one minds changing issue version to the most recent stable one?)

maciej.zgadzaj’s picture

StatusFileSize
new999 bytes

...and promised attachment. ;)

torotil’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

Hi,

I'm the new maintainer of opengraph_meta. Sorry for the long silence in the issue queue.

Sadly I don't have the resources to care for the Drupal 6 version. Unless and until someone steps up to maintain it I'm therefore closing all D6 issues as WONTFIX.

Feel free to re-open the issue if it is still valid in one of the Drupal 7 branches.

Thanks!

torotil’s picture

Hi,

I'm the new maintainer of opengraph_meta. Sorry for the long silence in the issue queue.

Sadly I don't have the resources to care for the Drupal 6 version. Unless and until someone steps up to maintain it I'm therefore closing all D6 issues as WONTFIX.

Feel free to re-open the issue if it is still valid in one of the Drupal 7 branches.

Thanks!