mhawksey / open-badges-issuer-addon

WordPress plugin designed as BadgeOS add-on to issue Open Badges
GNU Affero General Public License v3.0
4 stars 11 forks source link

Iframe with the Mozilla backpack modal is blank and can't be closed #5

Closed nsteinfeld closed 9 years ago

nsteinfeld commented 9 years ago

When I click the "Send to Mozilla Backpack" button regardless of the badge was admin-awarded or a submission. The iframe with the Mozilla backpack modal is displayed, but the page is blank and I can't use the x to close the iframe. I get the following errors in the browser error log:

https://backpack.openbadges.org/issuer/[[assertion.badge.image]] 404 (Not Found)
Unable to post message to http://backpack.openbadges.org. Recipient has origin https://backpack.openbadges.org.
postMessage ([native code], line 0)
postMessage (issuer.js, line 498)
(anonymous function) (issuer.js, line 616)

Example service end point for assertion:

{
  "status":"ok",
  "uid":"12-1434409764-3",
  "recipient": {
     "type":"email",
     "hashed":true,
     "salt":"0ct3L",
     "identity":
"sha256$a801ae9f00f7d7e2ac5e513ef5d764f44606ba7c187a12c36e526ca7b2923cd1"
  },
  "image":"http:\/\/aisdwlbadges.org\/wp-content\/uploads\/2015\/06\/TELL-BLAZER-Environment.png",
  "issuedOn":1434409764,
  "badge":"http:\/\/aisdwlbadges.org\/api\/badge\/badge_class\/?uid=12",
  "verify": {
     "type":"hosted",
     "url":"http:\/\/aisdwlbadges.org\/api\/badge\/assertion\/?uid=12-1434409764-3"
  }
}

I also posted in the support thread for the plugin: https://wordpress.org/support/topic/mozilla-backpack-iframe-is-blank-and-cant-be-closed?replies=2#post-7488991

mhawksey commented 9 years ago

hmm - what browser are you using (if unsure you can visit http://supportdetails.net/ )

nsteinfeld commented 9 years ago

It happens in the three browsers I tested: Chrome 45.0, Safari 8, and Firefox 40.0. The error message I pasted in my last comment was from Chrome. I get the same error message in the Safari browser console. I don't get that error in Firefox, but the following warning:

Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.     issuer.js:7:0

Here is a screenshot: open-badges-issuer-blank-iframe-chrome45

mhawksey commented 9 years ago

replicated identified issue to this line https://github.com/mhawksey/open-badges-issuer-addon/blob/master/open-badges-issuer-addon.php#L100

instead of

wp_register_script( 'mozilla-issuer-api', '//backpack.openbadges.org/issuer.js', array('badgeos-backpack'), null );

it needs to be

wp_register_script( 'mozilla-issuer-api', 'https://backpack.openbadges.org/issuer.js', array('badgeos-backpack'), null );

Just testing nothing else is at fault and then I'll push an update

mhawksey commented 9 years ago

Fix also pushed to wordpress.org/plugins. If still issues I can reopen. Thanks :)