Topic-icon SOLVED - Facebook open graph invalid parameter error

Active Subscriptions:

None
11 years 6 months ago - 11 years 5 months ago #49337 by aledue
Dir Team,

i was tracking this topic:
www.sourcecoast.com/forums/jfbconnect/jf...alid-parameter-error
I have the same issue as him.
I was trying everything but without success.
could you help me to resolve this problem, please?
I edited the file jomsocial.php
In /plugins/opengraph/jomsocial/jomsocial.php, could you replace the test code that Alex gave you

Code:

$image = $album->getCoverThumbPath();

$imageUrl = CRoute::getExternalURL($image);

$this->addOpenGraphTag('image', $imageUrl, false);

with the following:

Code:

$image = $album->getCoverThumbPath();

$uri = JURI::getInstance();

$base = $uri->toString(array('scheme', 'host', 'port'));

if(strpos($image, $base) === false)

$image = CRoute::getExternalURL($image);

$this->addOpenGraphTag('image', $image, false);

It works, but if i click on the link at facebook shows the error:
Album ID not valid
File Attachment:


File Attachment:


File Attachment:


File Attachment:


File Attachment:
Last edit: 11 years 5 months ago by aledue.
The topic has been locked.
Support Specialist
11 years 6 months ago #49339 by mel
There ended up being more code that was needed to resolve the issue. Could you rename rename the existing file in /plugins/opengraph/jomsocial/jomsocial.php to something else and copy this following file to that location (and remove the .txt extension)? www.sourcecoast.com/test_opengraph_jomsocial/jomsocial.php.txt

Please re-test and let me know if you have problems with it. I am currently testing the 6.2.4 release and would like to finalize any changes this week so that it can go out very soon.

-Melissa
The topic has been locked.
Active Subscriptions:

None
11 years 6 months ago #49350 by aledue
Thank for your answer. But it doesnt work...

File Attachment:

Should i pm you my credentials?
The topic has been locked.
Support Specialist
11 years 6 months ago #49358 by mel
If your Facebook application is set up that normal users can perform the Open Graph actions, then yes, you can PM me credentials.

Also, please provide the steps and URL for how you are trying to add the photo. Are you adding it through the user's activity feed or through an album page? If through the feed, could you try a second time?
The topic has been locked.
Support Specialist
11 years 6 months ago #49437 by mel
Alright, we got things working on your site! There were two issues... one with JomSocial and the other with JFBConnect:
1) JomSocial was inserting invalid Open Graph tags into the page. We removed these incorrect tags from the /components/com_community/helpers/view.php file. The code commented out was at line 127:
//                foreach ($images as $image) {
//                    self::addOpengraph('og:image', $image, true);
//                }
And then also and line 135 and 148 we removed the see_also Open Graph tags.

All of these tags were using relative links, when they should be fully URLs including the domain. I'd recommend letting the JomSocial team that these were causing problems to see if they can be fixed in an upcoming release. Until then, if you upgrade JomSocial, you'll want to make that change on your own.

2) There was a minor bug in our Open Graph - JomSocial plugin which wasn't always generating the correct URL. That fix will be included in the next release, due out sometime over the next week or so.

Please test and let us know how it goes, but things seem to be working well for us now.

Thanks for all your patience,
Melissa
The topic has been locked.
Active Subscriptions:

None
11 years 6 months ago #49552 by aledue
Hi,

i am getting this error message:

(#3502) Object at URL salsaysabor.de/bilder/642-alejandro/photo?albumid=3&photoid=62 has og:type of 'article'. The property 'gallery' requires an object of og:type 'salsaysabor-network:gallery'.

i was looking for help at google at i come to this comment:

USER wrote: This issue can occur if your page is restricted for logged in users or has some sort of session logic.


so i decide to change the permissions of privacy for everybody/all, but error still there.

what should i do? may i forget a setting?

mel wrote: Alright, we got things working on your site! There were two issues... one with JomSocial and the other with JFBConnect:
1) JomSocial was inserting invalid Open Graph tags into the page. We removed these incorrect tags from the /components/com_community/helpers/view.php file. The code commented out was at line 127:

//                foreach ($images as $image) {
//                    self::addOpengraph('og:image', $image, true);
//                }
And then also and line 135 and 148 we removed the see_also Open Graph tags.

All of these tags were using relative links, when they should be fully URLs including the domain. I'd recommend letting the JomSocial team that these were causing problems to see if they can be fixed in an upcoming release. Until then, if you upgrade JomSocial, you'll want to make that change on your own.

2) There was a minor bug in our Open Graph - JomSocial plugin which wasn't always generating the correct URL. That fix will be included in the next release, due out sometime over the next week or so.

Please test and let us know how it goes, but things seem to be working well for us now.

Thanks for all your patience,
Melissa

The topic has been locked.
Support Specialist
11 years 6 months ago #49571 by alzander
Please remember that Facebook will cache whatever data is scrapes from your pages. If you put your page into the Facebook Debug Tool, below, you'll still it still 'thinks' your gallery page redirects to the login page:
developers.facebook.com/tools/debug/og/object

After you switch the content of the page (or prevent that redirect), you'll need to either:
a) wait about a week for Facebook to re-scan the page
b) Run the debug tool above *AND* click the "Fetch New Scrape Information" button to have the data updated

Try that and let us know if it helps.

Thanks,
Alex
The topic has been locked.
Support Specialist
11 years 5 months ago #49591 by mel

This issue can occur if your page is restricted for logged in users or has some sort of session logic.

This is correct. When logged in as your user, I was able to see the correct og:type of 'salsaysabor-network:gallery' but when logged out was redirected to the login page, where the og:type was 'article'. This is what Alex was referring to above and because of the redirection, Facebook could only see the wrong Open Graph tags.

An example of the URL on the page: salsaysabor.de/bilder/642-alejandro/photo?albumid=3&photoid=62
In your Tools menu, the bilder menu was marked as Registered. I changed it to Public and Facebook was able to see the picture. Basically, if you want to post an action on Facebook that a picture was uploaded, the pictures must be public to everyone, not just registered users. If you want to continue to use actions, please review all of your menu items and decide which ones really need to be Registered versus Public.

You can see in your backend Open Graph > Activity List that I was able to successfully post your picture. You can also verify in your Facebook account's activity log that the action posted properly.

-Melissa
The topic has been locked.
Active Subscriptions:

None
11 years 5 months ago #49765 by aledue
Thank you very much! Finally with your great help and top support could solve the problem!!!!
The topic has been locked.
Support Specialist
11 years 5 months ago #49770 by mel
Great! Glad to hear that it's all resolved now.
The topic has been locked.