Skip to content

Changing versions breaks url_base property in ActiveCampaign class #119

@RonanBitpuma

Description

@RonanBitpuma

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions