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

Changing versions breaks url_base property in ActiveCampaign class #119

Open
RonanBitpuma opened this issue May 25, 2021 · 0 comments
Open

Comments

@RonanBitpuma
Copy link

The piece of code causing the issue:

function version($version) {
$this->version = (int)$version;
if ($version == 2) {
$this->url_base = $this->url_base . "/2";
}
}

This is what I do:
image

What I did to reproduce the bug

  1. I get the contact list
  2. This does not work, which is correct, as I haven't set the version
  3. I set the version to 2
  4. I get the contact list
  5. This works, as intended.
  6. I set the version back to 1, this is where the $url_base property 'breaks'
  7. I get the contact list
  8. This does not work, which is correct, as the version is back to 1
  9. I set the version back to 2
  10. I get the contact list
  11. This does not work, while it should. $ac->url_base now returns api_url.com/2/2 (Note the double /2!)

Because of this bug it requires me to create new instances of the ActiveCampaign class, instead of using one single instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant