
# Changelog

## 1.7.16 | February 19, 2025

- Fixed an issue with choice limits getting lost when adding Bulk Choices.

## 1.7.15 | January 7, 2025

- Improved compatibility with "Select all" and "Deselect All" buttons available for Select and Multiple Choice fields.
- Improved compatibility with Gravity Forms 2.9's handling of pricing fields.

## 1.7.14 | October 1, 2024

- Added new has_validation_error PHP method that can be called by other perks/plugins.

## 1.7.13

- Updated "Enable Limits" tooltip for clarity.

## 1.7.12

- Improved how exhausted choices are removed to prevent the input IDs of choices from changing.

## 1.7.11

- Fixed issue where the "Enable Limits" checkbox wasn't showing with newer versions of Gravity Forms when used with the Quiz Add-on. Additionally, issues with the checkbox and limit column not showing in GF 2.4 have been addressed.

## 1.7.10

- Fixed an issue where Javascript errors were thrown on Gravity Forms Admin for fields without choices.

## 1.7.9

- Added German translations. Credit: Florian Rinnhofer of sportunion.at
- Fixed issue where the "Enable Limits" setting would not be visible for some choice-based fields when using Gravity Forms 2.5 or newer.

## 1.7.8

- Updated location of "Enable Limits" checkbox to be under "Options" in Gravity Forms 2.5 and newer. A tooltip was also added for the option.
- Fixed issue where `gwlc-disabled` class would not be properly added to inputs.

## 1.7.7

- Fixed potential PHP warning in `GP_Limit_Choices::apply_choice_limits()` if a field does not have any choices.

## 1.7.6

- Fixed an issue where Remaining conditional logic based on exhausted fields did not evaluate correctly on submission.
- Added "Update URI" to plugin header to improve security.

## 1.7.5

- Fixed issue where remaining count conditional logic would not work with delayed payment feeds.

## 1.7.4

- Fixed conflict with GP Inventory which also uses the "limits-enabled" class to style it's custom input column.

## 1.7.3

- Updated how choice limits are fetched to use a standardized method.
- Added [gplc_choice_limit](https://gravitywiz.com/documentation/gplc_choice_limit/) filter to allow filtering choice limits when fetched.

## 1.7.2

- Fixed issue with Limit Choices not working with Conditional Logic as expected.

## 1.7.1

- Updated filter used to disable choices from `gform_field_content` to `gform_field_input` so choices were correctly disabled when hydrated by Populate Anything.
- Fixed issue where conditional logic for remaining choices would not be processed when using the PayPal Checkout Add-On causing checkout to fail.

## 1.6.34

- Improved support for Gravity Forms 2.5.
- Updated Gravity Perks minimum required version to 2.2.3.

## 1.7

- Improved support for Gravity Forms 2.5.
- Updated Gravity Perks minimum required version to 2.2.3.

## 1.6.33

- Fixed an issue where a vertical pipe in a Product field's value may cause GPLC to fail.
- Fixed issue where choiceless message did not display for choiceless fields.

## 1.6.32

- Fixed issue where evaluating if a field was exhausted always return true when no value was selected in that field.

## 1.6.31

- Added error catching when invalid form is passed via GF filters.

## 1.6.30

- Updated gplc_choice_counts filter so that the modified $counts variable is returned by the function.
- Fixed typo in filter name (gplc not gpls).

## 1.6.29

- Added [gplc_choice_counts](https://gravitywiz.com/documentation/gplc_choice_counts/) filter to allow sharing counts between different-valued choices.
- Updated plugin author.

## 1.6.28

- Fixed issue where only last choiceless field was correctly designated and rendered.

## 1.6.27

- Fixed issue where disabling choices (rather than removing) was not working as expected since version 1.6.26.

## 1.6.25

- Fixed potential performance issue when limiting choices on a form with a large amount of entries.

## 1.6.24

- Fixed issue where multiselect fields were not correctly limited.

## 1.6.23

- Added missing translation support for rogue string.

## 1.6.22

- Fixed issue where choice counts for multi-input fields were not correctly retrieved in GF 2.3.
    - Added two new filters: 'gwlc_is_edit_view' and 'gwlc_selected_values'

## 1.6.21

- Added support for GF2.3.

## 1.6.20

- Fixed issue where value was not properly sanitized when fetching choice counts.

## 1.6.19

- Fixed issue on Gravity View edit view where exhausted choices were not displayed though selected in current entry.

## 1.6.18

- Fixed issue limiting choices in multiselect fields with newer versions of Gravity Forms; field value now saved as JSON string.

## 1.6.17

- Fixed typo in localized string.
- Updated POT file.

## 1.6.16

- Added localization support.

## 1.6.15

- Fixed issue on Gravity Flow Detail page where exhausted choices were not displayed even when selected.
- Fixed issue where some 3rd party add-ons call gform_pre_render twice which can result in double-processing of choices.
- Updated GP_Bootstrap to v1.2.

## 1.6.14

    - Fixed issue where Product fields with values containing special characters were not counted towards the limit correctly.
    - Updated how Product field values are sanitized.

## 1.6.13

    - Fixed issue where validation was not re-executed on final form submission for multi-page forms.

## 1.6.12

    - Fixed issue where Remaining-based conditional logic did not work with Product fields.

## 1.6.11

    - Updated minimum GF version to 1.9.15; resolves issue with dependency on gf_apply_filters() function.

## 1.6.9

    - Fixed backwards-compat issue with pre GF-2.0 versions

## 1.6.8

    - Fixed issue where selections from products with associated quantity fields hidden by conditional logic were not counted towards the limit

## 1.6.7

    - Fixed issue where GF2.0 changed how field values were escaped which caused some limits to not be correctly applied

## 1.6.6

    - Updated perk to use GP_Bootstrap
    - Updated "gplc_pre_render_choice" filter to include form and field specific versions

# 1.6.5

    - Fixed issue where deleting a field that another field depends on for (Remaining) conditional logic will cause a JS error
    - Added 'gplc_requested_count' filter
    - Fixed issue where conditional logic for (Remaining) check fields even when not applicable

## 1.6.4

    - Added caching support to get_choice_counts() method to improve performance
    - Fixed issue where re-submitting the form by refreshing the confirmation page bypassed validation

## 1.6.3

    - Fixed issue where options with no limit were incorrectly limited

## 1.6.2

    - Fixed issue where products/options with inline quantity input were not limited correctly

## 1.6.1

    - Fixed issue where items were returning out of stock error even when none were ordered
    - Fixed issue where fields were pages on subsequent pages were being validated prematurely

## 1.6

    - Added support for counting actual quantity ordered towards Product and Option field limits
    - Added two new filters, "gplc_out_of_stock_message" and "gplc_not_enough_stock_message"
    - Updated "gplc_remove_choices" and "gplc_disable_choices" to use gf_apply_filters() w/ support for field-specific versions

## 1.5.9

    - Fixed issue where choices containing ampersands were not counted towards limit

## 1.5.8

    - Fixed issue where options were not correctly disabled due to change in GF generated value for drop down pricing fields

## 1.5.7

    - Fixed issue when conditional logic is triggered before script has initialized (like when prepopulating a value)

## 1.5.6

    - Fixed issue where gravityforms.js was not included automatically if frontend.js was not included

## 1.5.5

    - Fixed issue where "Remaining" conditional logic failed on submission when GF1.9 placeholder was applied on select

## 1.5.4

    - Fixed issue where "Remaining" conditional logic was failing when GF1.9 placeholder was used on select

## 1.5.3

    - Fixed issue where exhausted choices were no longer correctly disabled when not removed due to change in Gravity Forms choice HTML IDs.

## 1.5.2

    - Added support for conditional logic based on whether or not the field's choices are exhausted

## 1.5.1

    - Fixed an issue where validation was no longer being processed if choices are not disabled (they are not by default)

## 1.5

    - Updated for Gravity Forms 1.9 release

## 1.4.9

    - Added "gplc_completed_payments_only" filter (pseudonym for "gwlc_approved_payments_only" filter)
    - Fixed issue where "gwlc_approved_payments_only" no longer functioned correctly since GF changed "Approved" status to "Paid"

## 1.4.8

    - Fixed bug with remaining choices conditional logic when used with radio button fields

## 1.4.7

    - Removed code that attempted to select a default value (workaround for Gravity Forms bug that is no resolved)
    - Fixed bug where multiselect options were not disabled when applicable

## 1.4.6

    - Fixed issue where limit-enabled options were selected as default value even if non-limit-enabled option was already selected

## 1.4.5

    - Fixed issue where first option was selected if a field was hidden and then shown via conditional logic even if that option was disabled

## 1.4.4

    - Fixed bug where init script was registered even if no limits were applied to form

## 1.4.3

    - Added new filter: 'gplc_disable_choices'; if choices are not removed, they will be automatically disabled. This filter allows exhausted options to be selectabled
    - Added support for bypassing validation when exhausted choice is configured to not be removed and not be disabled (supports "waiting list" concept)
    - Added support for conditional logic based on the count remaining for any given choice (checkbox and multiselect fields not yet supported)
    - Fixed bug where a limit of "0" allowed the choice to still be selected once
    - Updated min version of GF to 1.8.9
    - Updated min version of GP to 1.2.5

## 1.4.2

    - Fixed issue where choices were not properly disabled when they contained an ampersand (value used to search for disabled replacment was not properly esc to match GFs)
    - Fixed styling issue which revealed limits choices UI in error

## 1.4.1

    - Fixed issue where choices with very long labels/values were not correctly limited

## 1.4

    - Added support for multiselect fields

## 1.3.1

    - Fixed issue where checkboxes were not correctly limited
    - Added gp_limit_choices() function to return static instance of class
    - Updated code base with various improvements
    - Updated class to singleton
    - Updated required minimum version of Gravity Perks to 1.2

## 1.3

    - Added hook 'gplc_choiceless_message' to allow modifying the message (and markup) displayed when there are no choices available for a field

## 1.2.4

- Updated documentation to return gwiz.com URL
- Updated changelog.txt format

## 1.2.3

- Fixed issue where new gplc_remove_choices hook ignores value returned the gwlc_remove_choices hook
- Fixed whitespace issues
- Fixed issue where if option is specified as preselected it will be preselected even if the limit is exceeded

## 1.2.2

- Fixed issue where drop down Option fields were not properly disabled when gplc_remove_choices hook returns false

## 1.2.1

- Fixed bug where '0' was acting as limit of '1'

## 1.2

- Added 'gplc' prefixed hooks
- Updated code to run choices through gplc_pre_render_choice hook regardless of whether any choices have been selected prior

## 1.1.9

- Fixed styling issue in the admin where choice row would wrap when choices container had enough items to scroll
- Fixed issue where adding item via "Bulk Add" would not display limit inputs for new choices

## 1.1.8

- Added support for multi-choice 'option' pricing fields

## 1.1.7

- Added class to disabled elements for styling disabled elements in older browsers

## 1.1.6

- Fixed notice for undefined variable

## 1.1.5

- Added support for disabling items rather than removing them, activated by 'gwlc_remove_choices' hook returning false.

## 1.1.4

- Remove rogue print_rr, classic...

## 1.1.3

- Added new hook: gwlc_choice_counts_query Allows full cusotmization of the get choice counts query

## 1.1.2

- Fixed issue where if there were no more options on a required field and the user attempted to submit the form it would still successfully send.

## 1.1.1

- Fixed typo in documentation

## 1.1

- Added checkbox field support

## 1.0

- Added documentation and documentation images.
- Added two hooks: gwlc_remove_choices and gwlc_pre_render_choice
- Added safety net
- Added support for passing 0 as a limit
- Added support for approved payments only