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

Prevent array to string conversion error with form selects mapped to Contact state #5440

Merged
merged 1 commit into from
Dec 21, 2017

Conversation

alanhartless
Copy link
Contributor

Q A
Bug fix? y
New feature?
Automated tests included?
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs)
BC breaks?
Deprecations?

Description:

When using a form field mapped to a custom field State type, an array to string error will be thrown due to state array expecting option group support.

Steps to reproduce the bug:

  1. Create a form
  2. Add a select field
  3. Map it to the contact state field
  4. On the Properties tab, select Yes to use the custom field's values
  5. Save and note the array to string error

Steps to test this PR:

  1. Repeat and the state dropdown will be generated
  2. Also create a select custom field if you don't already have one and map a form field to it using the custom field values to ensure it generates without option groups

List deprecations along with the new alternative:

List backwards compatibility breaks:

…to use the values of a custom field that's using the built in state list
@alanhartless alanhartless added bug Issues or PR's relating to bugs ready-to-test PR's that are ready to test labels Dec 12, 2017
@alanhartless alanhartless added this to the 2.12.1 milestone Dec 12, 2017
@dbhurley
Copy link
Member

+1

@javjim
Copy link

javjim commented Dec 19, 2017

was able to reproduce bug and fix is working properly

@javjim javjim added pending-test-confirmation PR's that require one test before they can be merged and removed ready-to-test PR's that are ready to test labels Dec 19, 2017
@javjim javjim assigned javjim and unassigned javjim Dec 19, 2017
Copy link
Sponsor Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error is gone and all selects work 👍

@escopecz escopecz merged commit 781abb2 into mautic:staging Dec 21, 2017
@alanhartless alanhartless deleted the bug-form-select-optgroup branch January 5, 2018 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs pending-test-confirmation PR's that require one test before they can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants