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

NativeParser stops processing if value in array evaluates to false #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brumiser1550
Copy link

The while loop breaks if any value in the array being processed evaluates to false, this causes any information that proceeds the element to not be parsed. I believe that the code should only be checking if there is a data point set, not if it is also truthy.

This is an example of an array that comes back without fully being processed due to the while loop check.

Array
        (
            [_AccountStalled] => 0
            [_LastUpdated1] => stdClass Object
                (
                    [scalar] => 20210920T00:00:00
                    [xmlrpc_type] => datetime
                    [timestamp] => 1632096000
                )

            [Id] => 7
            [LastUpdated] => stdClass Object
                (
                    [scalar] => 20210920T16:54:17
                    [xmlrpc_type] => datetime
                    [timestamp] => 1632156857
                )

        )

With my change, it passes, and completes the parsing process resulting in

Array
        (
            [_AccountStalled] => 0
            [_LastUpdated1] => DateTime Object
                (
                    [date] => 2021-10-28 00:00:00.000000
                    [timezone_type] => 3
                    [timezone] => UTC
                )

            [Id] => 7
            [LastUpdated] => DateTime Object
                (
                    [date] => 2021-11-04 23:05:11.000000
                    [timezone_type] => 3
                    [timezone] => UTC
                )

        )

The while loop breaks if any value in the array being processed evaluates to false, this causes any information that proceeds the element to not be parsed.
@brumiser1550
Copy link
Author

Does nobody else see this as a problem? It seems like a pretty obvious logic fix, any chance this can be merged in?

@brumiser1550 brumiser1550 mentioned this pull request Jul 3, 2024
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.

1 participant