Skip to content

Bug/Issue: Custom Fields stripping script tags in Joomla 6.0.2 despite "No Filtering" and "Raw" settings #46746

@1405djarnis

Description

@1405djarnis

Steps to reproduce the issue
Environment Setup: Ensure "Global Configuration" -> "Text Filters" is set to "No Filtering" for the Super User group.

Field Creation: Create a new Custom Field (com_fields) of type "Editor" or "Text Area".

Field Settings: * Set Filter to "Raw".

Under Permissions, set "Edit Custom Field Value" to "Allowed" for Super Users.

Set Automatic Display to "Do not automatically display".

Editor Setup: Set the user profile to "Editor - None" (to rule out any JS editor cleaning).

Data Entry: Open an article and enter a script in the custom field, e.g.: <script>console.log('Test');</script>.

Save: Click "Save" or "Save & Close".

Expected result
The <script> tags and the JavaScript code should be saved exactly as entered, because the filter is set to "Raw" and the user has "No Filtering" permissions.

Actual result
The <script> tags are stripped/removed upon saving. In some cases, the entire content of the field is wiped clean. The same script saves perfectly when pasted directly into the article body (com_content), but fails in the custom field (com_fields).

System information (as much as possible)
Joomla Version: 6.0.2

PHP Version: 8.4.16

MySQLi Version:* 10.6.23-MariaDB-ubu2204

Caching: Enabled

Gzip: Enabled

Editors Tested: JCE (with script allowed), TinyMCE (with script allowed), and Editor - None.

Additional comments
This issue makes global code management impossible. Since the global field won't store the script tags, I am forced to manually insert the script in every single article. This defeats the purpose of using Custom Fields for reusable code snippets and makes site maintenance extremely inefficient. It appears com_fields ignores the "No Filtering" and "Raw" settings that work correctly in com_content.

Regards,
John

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions