No Code Attached Yet
avatar niosme
niosme
5 Nov 2026

What happened?

  1. Open an article, go to the Schema tab and choose the Custom type.
  2. Paste valid JSON-LD that contains non-ASCII text, for example:
{
    "@context": "https://schema.org",
    "@type": "Service",
    "name": "Δώρα",
    "url": "https://example.com/dora"
}
  1. Save the article and open the Schema tab again.

Version

6.2

Expected result

The JSON in the textarea keeps the characters as entered ("name": "Δώρα", "https://schema.org").

Actual result

On save the JSON is re-encoded, so the textarea shows:

{
    "@context": "https:\/\/schema.org",
    "@type": "Service",
    "name": "\u0394\u03ce\u03c1\u03b1",
    "url": "https:\/\/example.com\/dora"
}

The frontend output is still correct, because the system plugin encodes it with JSON_UNESCAPED_UNICODE. But on any site in Greek, Cyrillic, Arabic, Chinese and so on, the JSON can no longer be read or edited in the backend, and every save escapes it again.

System Information

Joomla 6.2.0, PHP 8.3.36, MariaDB 10.5.26. The same code is in 6.2-dev and 6.3-dev.

Additional Comments

The cause is plugins/schemaorg/custom/src/Extension/Custom.php, line 89, in onSchemaPrepareSave():

$schema->set('json', json_encode($json, JSON_PRETTY_PRINT));

Adding two flags keeps the text readable, and the result is still valid JSON:

$schema->set('json', json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));

The system plugin already uses both flags for the frontend output. Happy to open a pull request with this change.

avatar niosme niosme - open - 5 Nov 2026
avatar joomla-cms-bot joomla-cms-bot - change - 5 Nov 2026
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Nov 2026
avatar niosme niosme - change - 5 Nov 2026
The description was changed
avatar niosme niosme - edited - 5 Nov 2026

Add a Comment

Login with GitHub to post a comment