When trying to parse JSON with nested arrays, the context works as designed. Ie.
Context: $.results.*
{
results: [
{
key: 'value',
}
]
}
But I get an error when I attempt to parse a flat array with an empty context. Ie.
Context: $.*
{
key: 'value',
}
which results in the following error:
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=59&op=do StatusText: Service unavailable (with message) ResponseText: Recoverable fatal error: Argument 1 passed to FeedsJSONPathParser::invokeHook() must be of the type array, boolean given, called in /feeds_jsonpath_parser/FeedsJSONPathParser.inc on line 80 and defined in FeedsJSONPathParser->invokeHook() (line 433 of /feeds_jsonpath_parser/FeedsJSONPathParser.inc).
It seems that the parser expects a context as an array.
Comment | File | Size | Author |
---|---|---|---|
#5 | 2628604-5.patch | 627 bytes | ameymudras |
|
Comments
Comment #2
firewaller CreditAttribution: firewaller commentedAdded context array check to prevent errors
Comment #3
firewaller CreditAttribution: firewaller commentedThe above patch causes an error for all imports with multidimensional contexts.
Attached is an updated patch that checks for flat contexts.
Comment #4
markchitty CreditAttribution: markchitty as a volunteer commented#3 solved the issue on my setup, existing multidimensional imports still worked too! thanks.
Comment #5
ameymudras CreditAttribution: ameymudras as a volunteer commentedI also faced the same issue but the above patch didn't. The problem is happening because the invokeHook method assumes its first argument to be a array but when there is a flat array or some in consistency in the JSON it doesn't work as expected. The best solution according to me would be dropping the type casting. Providing a patch for the same.
Comment #6
ameymudras CreditAttribution: ameymudras as a volunteer commented