Skip to content

Conversation

@Quwex
Copy link

@Quwex Quwex commented Jan 29, 2026

without this patch I get the following error on building Desktop Linux if Cpanel::JSON::XS is installed

perl ./util/create-l10n-all-js.pl >dist/l10n-all.js
hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this)
at ./util/create-l10n-all-js.pl line 69.

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

  • Resolves: #
  • Target version: main

Summary

TODO

  • ...

Checklist

  • I have run make prettier-write and formatted the code.
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

without this patch I get the following error on building Desktop Linux if
Cpanel::JSON::XS is installed
```
perl ./util/create-l10n-all-js.pl >dist/l10n-all.js
hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this)
at ./util/create-l10n-all-js.pl line 69.
```

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.

Signed-off-by: Sarper Akdemir <[email protected]>
Change-Id: I4f6986a2fe5013f29ef124e0a0c92880fe249d2c
@timar
Copy link
Member

timar commented Jan 29, 2026

similar PR: #14245

@Quwex
Copy link
Author

Quwex commented Jan 30, 2026

similar PR: #14245

ah my bad, didn't realize there was a PR on the topic already!

@github-project-automation github-project-automation bot moved this from To Review to To Test in Collabora Online Feb 3, 2026
@timar timar merged commit a64d2cb into distro/collabora/coda-25.04 Feb 3, 2026
3 checks passed
@timar timar deleted the private/quwex/fix-l10n-perl-err-cpanel-json-xs branch February 3, 2026 09:30
@github-project-automation github-project-automation bot moved this from To Test to Done in Collabora Online Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants