fix: share certificate in FB#31578
Conversation
|
Thanks for the pull request, @DmytroAlipov! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
|
@DmytroAlipov looks like there's a failed test. |
75ecfdf to
08b3d84
Compare
|
@e0d Hi! I found cases that led to incorrect work. Fixed everything and added tests. Please try again to run the test. |
|
@DmytroAlipov I've approved the tests. |
Fixed the Course Card Image is absent on FB post after sharing by user.
08b3d84 to
681cc92
Compare
|
@e0d sorry, I used the f-string in the test where it was not needed, and the test failed in that place. I fixed it and push again. |
|
@DmytroAlipov tests approved. |
|
Hi @DmytroAlipov! Looks like this is ready for review/merge - can you confirm and I'll have someone take a look? |
|
@mphilbrick211 Yes, sure. I confirm. |
|
@jmakowski1123 @ProductRyan This is ready for your review. |
|
On closer review, this is a simple bug fix and doesn't require product review. @mphilbrick211 |
|
Hi @hurtstotouchfire - could you take a look at this? Thanks! |
|
Hi @DmytroAlipov - looks like some tests above need to be re-run. Would you mind taking a look? |
|
Hi @mphilbrick211! So if the branch is up-to-date and the tests are passing, I'm not quite sure what I should do. |
|
@DmytroAlipov looks good now! I've marked it as ready for review. |
|
@hurtstotouchfire do you know when this review is scheduled for? |
|
@e0d Hi! This PR is still not merged. Could you please ping the person responsible for continuing the review of this PR? |
|
Hi @hurtstotouchfire and @openedx/2u-aperture! Just checking back in to see if this can get this reviewed soon? |
|
I'm taking a look at this today! Sorry for the delay. |
| ## OG (Open Graph) url, title, type, image and description added below to give social media info to display | ||
| ## (https://developers.facebook.com/docs/opengraph/howtos/maximizing-distribution-media-content#tags) |
There was a problem hiding this comment.
Thanks for adding a link back to the best practices! 👏
justinhynes
left a comment
There was a problem hiding this comment.
Thanks for the update and all the extra context in the PR itself.
|
@justinhynes thanks for the review. @DmytroAlipov won't be able to merge, can you push the button when it works on your side? |
|
Ah, gotcha! I'll merge first thing tomorrow morning (USA -- EST time). cc: @DmytroAlipov |
|
I've merge changes on the base into the branch from the GitHub UI. This will cause the tests to re-run, but all should be GTG tomorrow. |
|
@DmytroAlipov 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
Fixed an issue where the Course Card Image was missing in an FB post after a user shared it.

Description
In order to share the certificate on your Facebook page, the code was used
FaceBook.share({share_text: '${facebook_share_text | n, js_escaped_string}', share_link: '${share_url | n, js_escaped_string}', picture_link: '${full_course_image_url | n, js_escaped_string}', description: '${_('Click the link to see my certificate.') | n, js_escaped_string}'});In this case, the picture that was transmit in the picture_link parameter was ignored.
During the investigation, it was revealed that Facebook changed the rules for sharing. Meta tags must be used (follow FB rules).


After making changes to the code, the Course Card Image is displayed when you share the certificate.
In Studio:
In FB:
Sharing Debugger was used for debugging.

The default image is /static/studio/images/pencils.jpg if the course image is not loaded. Displayed as:
NOTE:
og:urlandshare_linkare the same. The "share to FB" button will not work withoutshare_link: '${share_url | n, js_escaped_string}'. But if you do not specifyog:url, the FB debugger asks you to specify the entire set of meta tags. If you do not passog:urlthere will be no errors, but I decided to do as FB recommends.