gladiopeace / opensocial-php-client

Automatically exported from code.google.com/p/opensocial-php-client
Apache License 2.0
0 stars 0 forks source link

Myspace notifications button0_params argument must be double encoded #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a notification for myspace with json_encoded button0_params
2. Try sending the notfication

What is the expected output? What do you see instead?

They respond with a 201, which means it was created. However, it was not
created. It was rejected because the button0_params teplateParameter needs
to be double urlencoded.

What version of the product are you using? On what operating system?

v1.1.1

Please provide any additional information below.

If you construct the templateParams like:

  $notification->setTemplateParameter('content', 'blah blah');
  $notification->setField('recipientIds', array($userId));
  $notification->setField('templateParams'  => array(
        'button0_surface'  => 'canvas',
        'button0_label'    => 'Check it out',
        'button0_params'  => json_encode(array(
          'param1'      => 'val1',
          'param2'        => 'val2'
        ))
      )

Their service will return 201, which means it should have sent. However,
you have to url encode the 'button0_params' value in order to get it to
actually send.

See patch for proposed fix.

Original issue reported on code.google.com by sma...@gmail.com on 5 Nov 2009 at 8:34

Attachments:

GoogleCodeExporter commented 9 years ago
Oops, I made a couple mistakes above.

 1) The patch has a bug in it. Attached is the fixed patch.

 2) It will sometimes create the notificaiton, but the appParams bag (the url
parameters it uses in the link to the canvas) is maleformed. URLEncoding fixes 
this.

Original comment by sma...@gmail.com on 5 Nov 2009 at 8:56

Attachments: