Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC break with custom fields on Subscription when updating customer notes #369

Closed
HeahDude opened this issue Sep 20, 2018 · 4 comments
Closed
Assignees
Labels
V2 V2 Client

Comments

@HeahDude
Copy link

Hello,

we recently updated from version 2.10.1...2.10.3 and we have a bc break when calling:

$recurlySubscription->updateNotes([
    'customer_notes' => 'Some note'.PHP_EOL,
]);

Wheres it used to work fine, it now triggers an The provided XML was invalid.:

<?xml version="1.0" encoding="UTF-8"?>\n
<error>\n
  <symbol>invalid_xml</symbol>\n
  <description>The provided XML was invalid.</description>\n
  <details>Unacceptable tag &lt;custom_fields&gt;</details>\n
</error>\n

It looks like:

<?xml version="1.0"?>
<subscription>
    <subscription_add_ons></subscription_add_ons>
    <customer_notes>Some note.\n</customer_notes>
    <custom_fields></custom_fields>
</subscription>

while compared to the expected:

<subscription>
    <subscription_add_ons></subscription_add_ons>
    <customer_notes>Some note.\n</customer_notes>
-   <custom_fields></custom_fields>
</subscription>

I'm currently fixing it by doing:

// fix
unset($recurlySubscription->custom_fields);
// regular call
$recurlySubscription->updateNotes(/* ... */);

Don't know what's the best way to fix this, I can provide a PR is someone can point me in the right direction. Thanks!

@aaron-junot aaron-junot self-assigned this Sep 20, 2018
@aaron-junot
Copy link

@HeahDude, thanks for bringing this up! I'm going to take a look and see if I can reproduce it. If so, I'll point you in the right direction if you'd like to do a PR

@aaron-junot
Copy link

aaron-junot commented Sep 20, 2018

@HeahDude, I was able to reproduce that behavior when checking out commit 48b0ace, but it does not throw the error when I use current master. I believe it was fixed in #361. Is there any way you could upgrade to 2.10.4 and see if you still encounter the same issue?

@HeahDude
Copy link
Author

Thank you @aaron-suarez for your answer and having looked into it already.

I will try to update as you suggest and let you know.

@HeahDude
Copy link
Author

Indeed, upgrading to 2.10.4 fixes the issue. Closing here.

Thank you @aaron-suarez for the support.

@bhelx bhelx added the V2 V2 Client label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V2 V2 Client
Projects
None yet
Development

No branches or pull requests

3 participants