# Bug in your php api

**URL:** <https://www.patreondevelopers.com/t/bug-in-your-php-api/4508>\
**Category:** Uncategorized\
**Created:** [June 8, 2021, 11:21am UTC](https://www.patreondevelopers.com/t/bug-in-your-php-api/4508 "2021-06-08T11:21:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gwood](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@gwood](https://www.patreondevelopers.com/u/gwood)\
**Post date:** [June 8, 2021, 11:21am UTC](https://www.patreondevelopers.com/t/bug-in-your-php-api/4508/1 "2021-06-08T11:21:03Z")

</div>

In v2, page[count] has been replaced with page[size] to adhere to the JSONAPI spec. But the PHP API doesn’t include this update.

So on this function:

`fetch_page_of_members_from_campaign()`

Replace:

`$url = campaigns/{$campaign_id}/members?page%5Bcount%5D={$page_size};`

With:

`$url = campaigns/{$campaign_id}/members?page%5Bsize%5D={$page_size};`

Can you please push this to the github package?

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [June 8, 2021, 3:16pm UTC](https://www.patreondevelopers.com/t/bug-in-your-php-api/4508/2 "2021-06-08T15:16:58Z")

</div>

Does the function fail when you attempt to use it?

---

<div class="post-metadata">

**Author:** ![gwood](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@gwood](https://www.patreondevelopers.com/u/gwood)\
**Post date:** [June 8, 2021, 6:42pm UTC](https://www.patreondevelopers.com/t/bug-in-your-php-api/4508/3 "2021-06-08T18:42:52Z")

</div>

No, but the page parameter is _incorrect_ and not working as I outlined above. Meaning, there is no way to fetch more than 20 members at a time in the current function.

The reason is because there is a bug in the function. You will need to adjust `page%5Bcount` to `page%5Bsize` and then the `$page_size` variable will work properly.

It is very easy for you to verify this. Set $page\_size for example to 100 and you will see what I mean.

You really need to adjust the PHP API on github with this fix.

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [June 8, 2021, 7:33pm UTC](https://www.patreondevelopers.com/t/bug-in-your-php-api/4508/4 "2021-06-08T19:33:01Z")

</div>

> [@gwood](#):
>
> Meaning, there is no way to fetch more than 20 members at a time in the current function.

I believe it was not possible to get more than 20 listings from the api already, regardless of the parameter. Needs to be checked.

---

<div class="post-metadata">

**Author:** ![gwood](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@gwood](https://www.patreondevelopers.com/u/gwood)\
**Post date:** [June 9, 2021, 7:50am UTC](https://www.patreondevelopers.com/t/bug-in-your-php-api/4508/5 "2021-06-09T07:50:22Z")

</div>

I just checked and yes, you can get more than 20 with the corrected code I provided you. Have you had a chance to test it yourself? And if you did, will you push this correction to the github package?

I just provided you a fix to the bug so not sure how much more I can help you. =)

Are you a third-party developer who is working for Patreon? Are you the maintainer of the github packages? If not, please let me know who I should connect with.

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [June 9, 2021, 9:01pm UTC](https://www.patreondevelopers.com/t/bug-in-your-php-api/4508/6 "2021-06-09T21:01:27Z")

</div>

Do you have an outstanding pr at github?

---

<div class="post-metadata">

**Author:** ![gwood](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@gwood](https://www.patreondevelopers.com/u/gwood)\
**Post date:** [June 11, 2021, 8:59am UTC](https://www.patreondevelopers.com/t/bug-in-your-php-api/4508/7 "2021-06-11T08:59:29Z")

</div>

I am not on github unfortunately (long story). Can you update it?

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [July 13, 2021, 12:47pm UTC](https://www.patreondevelopers.com/t/bug-in-your-php-api/4508/8 "2021-07-13T12:47:51Z")

</div>

Updated.

> **[Patreon/patreon-php](https://github.com/Patreon/patreon-php)**
>
> Interact with the Patreon API via OAuth. Contribute to Patreon/patreon-php development by creating an account on GitHub.
