- Status changed to Needs work
about 1 year ago 11:06am 20 April 2024 - 🇳🇱Netherlands megachriz
Perhaps this indicates that it would be useful to port the following from the D7 version of Feeds Extensible Parsers:
Also needs automated tests.
- last update
about 1 year ago 98 pass, 2 fail - last update
about 1 year ago 113 pass - 🇯🇵Japan ptmkenny
Ok, I rewrote the patch and updated the existing tests, which already cover this exception. I also updated the invalid JSON test by using a common JSON error (adding an extra comma at the end of a pair) instead of a plaintext string so that the test expectation is more clear.
The debug feature is interesting, but for this specific issue, I think it makes sense to simply show the bad JSON without asking the user for their preference. When the user is importing JSON, and it fails, they probably always want to know what went wrong.
- Status changed to Needs review
about 1 year ago 3:19pm 22 April 2024 - Status changed to Needs work
about 1 year ago 12:44pm 23 April 2024 - 🇳🇱Netherlands megachriz
There is a PHP variable used in a translatable string. See MR for details.
- last update
about 1 year ago 92 pass, 8 fail - last update
about 1 year ago 113 pass - Status changed to Needs review
about 1 year ago 2:53pm 23 April 2024 - 🇯🇵Japan ptmkenny
I fixed the exception translation and I removed StringTranslationTrait since translating exceptions was its only use.
- last update
11 months ago 116 pass - last update
11 months ago 116 pass -
MegaChriz →
committed 5a6ed0fe on 8.x-1.x authored by
ptmkenny →
Issue #3228617 by ptmkenny: Display the JSON string on an error.
-
MegaChriz →
committed 5a6ed0fe on 8.x-1.x authored by
ptmkenny →
- Status changed to Fixed
11 months ago 1:00pm 25 May 2024 - 🇳🇱Netherlands megachriz
I rebased the code to see if there were any phpcs errors and luckily there aren't.
I also wondered if instead of displaying the whole JSON, if perhaps the error message could be more specific on where the JSON is wrong, but not sure if there is an easy way to display that.
json_last_error_msg()
does not give any useful info on a syntax error at least.So I merged the code. We could open a follow-up if you have ideas on how the JSON error could perhaps be more specific.
Automatically closed - issue fixed for 2 weeks with no activity.