christianwach / civicrm-wp-member-sync

CiviCRM WordPress Member Sync plugin keeps a WordPress user in sync with a CiviCRM membership by granting either a role or capabilities to a WordPress user who has that membership.
https://wordpress.org/plugins/civicrm-wp-member-sync/
GNU General Public License v2.0
17 stars 10 forks source link

Membership types limited to 25 by default api call #21

Closed axaak closed 6 years ago

axaak commented 7 years ago

Hi, thank you for the plugin, its really helped our organisation. When adding Association rules the dropdown list of available types is limited to 25 membership types. This is because the api call in https://github.com/christianwach/civicrm-wp-member-sync/blob/master/civi-wp-ms-members.php

types_get_all() line 639 does not specify options.limit. Without this set the civirm api will only return 25 results, You can test this in the API explorer or see here: https://civicrm.stackexchange.com/questions/2932/how-do-i-get-more-than-25-records-from-the-api

Changing from // get membership details $membership_type_details = civicrm_api( 'MembershipType', 'get', array( 'version' => '3', 'sequential' => '1', )); to $membership_type_details = civicrm_api( 'MembershipType', 'get', array( 'version' => '3', 'sequential' => '1', 'options' => array( 'limit' => 100, ), )); ups the limit. Zero for all.

Please could you amend the code to include limit so that we can support >25 types?

Thanks, axa

christianwach commented 7 years ago

@axaak Good catch - thanks! Should be fixed in 077223389320e8682beddc38f4e51d2646becfd1.

axaak commented 7 years ago

Thanks for such a quick turn around,we really appreciate it :-) axa

christianwach commented 6 years ago

Closing this now that I have updated the plugin in the WordPress Plugin Directory.