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

fix for force_array behavior #57

Conversation

ThisIsNotTheUserYouAreLookingFor
Copy link
Contributor

Hi there!

This change fixes #46
I did not run the test suite, since I didn't have a lot of time on my hands, I did run with my own test data though.

The behavior has been fixed as follows:

  • Instead of a return used next to skip the empty array xpath result
  • Initialized result array just before the foreach.
  • Added force_array behavior as follows:
    • If the result array size is bigger than one, always set as array
    • If the result array is one and force_array => false take the element and add it as a string to the event

feel free to adjust/throw it against the test suite and let me know what you think!

This fix implements the force_array => false behavior without having to write to a separate tag.
put the initialization of the array on the correct level, derpy mistakes are derp
@jsvd
Copy link
Member

jsvd commented Nov 6, 2018

merged in 1620c37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Force_array is not applied correctly.
2 participants