fix create-l10n-all-js.pl for Cpanel::JSON::XS #14258
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
without this patch I get the following error on building Desktop Linux if Cpanel::JSON::XS is installed
since (Change-Id: I36c6b38acc0930eb6e005479f7cf7003bbeec3a5), which reinstantiates b578c15:(Change-Id: Ia26802ac1ebe9fc696d23706f9bab6b84f0efab4)
The encode_json() function in Cpanel::JSON::XS (v4.40 is what I have installed on my machine) rejects simple scalar values (strings) by default, requiring a hashref or arrayref.
Fix by using $json_pretty->encode() with allow_nonref enabled for Cpanel::JSON::XS. This allows encoding scalar values when comparing translation entries for the overwrite warning.
AFAICS, this is only the case for Cpanel::JSON::XS, and not for other json lib options.
Change-Id: I4f6986a2fe5013f29ef124e0a0c92880fe249d2c
Summary
TODO
Checklist
make prettier-writeand formatted the code.make checkmake runand manually verified that everything looks okay