RTC bug PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar Divya3215
Divya3215
29 Mar 2026
  • I read the Generative AI policy and my contribution is compatible with the policy and GNU/GPL 2 or later.

Pull Request resolves #47488 .

Summary of Changes
This PR resolves an issue where alternative layouts ( template overrides ) ignored the 'option' and 'title' attributes in their XML files, displaying only the filename (e.g "alt') in the dropdown. This fix brings consistency between core component layouts and template overrides.

Testing Instructions
1.Create a template override for Category Blog in your active template:
path:
templates/[your_template]/html/com_content/category/alt.php
path:
templates/[your_template]/html/com_content/category/alt.php
2.Edit alt.xml and set:

   <layout title="MY_TITLE" option="MY_OPTION_TEXT">.

3.Go to Articles>options>Category tab.
4.Open the "Choose a Layout" dropdown

Actual result BEFORE applying this Pull Request
The dropdown item for the template overide shows only the filename: "alt".

Expected result AFTER applying this Pull Request
The dropdown item correctly displays the translated text or string from the XML attribute:"MY_OPTION_TEXT".

Screenshot

Screenshot (3)

Link to documentations
Please select:

  • No documentation changes for guide.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar Divya3215 Divya3215 - open - 29 Mar 2026
avatar Divya3215 Divya3215 - change - 29 Mar 2026
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 Mar 2026
Category ⇒ Libraries
avatar Divya3215 Divya3215 - change - 29 Mar 2026
The description was changed
avatar Divya3215 Divya3215 - edited - 29 Mar 2026
avatar Divya3215 Divya3215 - change - 29 Mar 2026
The description was changed
avatar Divya3215 Divya3215 - edited - 29 Mar 2026
avatar Divya3215 Divya3215 - change - 30 Mar 2026
Labels Added: PR-5.4-dev
avatar muhme muhme - change - 30 Mar 2026
Title
…
Fix: Ensure 'option' and 'title' attributes are respected in alternative layout XML
[5.4] Ensure 'option' and 'title' attributes are respected in alternative layout XML
avatar muhme muhme - edited - 30 Mar 2026
avatar rvbgnu
rvbgnu - comment - 21 Aug 2026

on a Test site for PBF, I run into another issue:

  • Open Templates > Cassiopeia > Create Overrides > com_content > Category:
  • error: 20 Joomla\Filesystem\Path::check() - Snooping out of bounds @ com_content/category
Screenshot 2026-08-21 at 13-30-31 Error 20
avatar MacJoom
MacJoom - comment - 21 Aug 2026

Fixed with #48274

avatar MacJoom
MacJoom - comment - 21 Aug 2026

Fixed with #48274
Regression from the last release.

avatar rbuelund rbuelund - test_item - 22 Aug 2026 - Tested successfully
avatar rbuelund
rbuelund - comment - 22 Aug 2026

I have tested this item ✅ successfully on bb280cd


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47495.

avatar rbuelund
rbuelund - comment - 22 Aug 2026

I have tested this item ✅ successfully on bb280cd


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47495.

avatar coolcat-creations coolcat-creations - test_item - 22 Aug 2026 - Tested successfully
avatar coolcat-creations
coolcat-creations - comment - 22 Aug 2026

I have tested this item ✅ successfully on bb280cd

Tested successful - the Option is shown in the drop down list. BUT

When using invalid xml I have 3x this error over the screen:
I have Warning: simplexml_load_file(): /joomla/testabc/templates/cassiopeia/html/com_content/article/alternatelayout.xml:9: parser error : Premature end of data in tag metadata line 2 in /Users/elisa/Development/joomla/testabc/libraries/src/Form/Field/ComponentlayoutField.php on line 216

Before applying the patch there was no such warning for the invalid xml. Maybe there is a need to catch this case?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47495.

avatar coolcat-creations
coolcat-creations - comment - 22 Aug 2026

I have tested this item ✅ successfully on bb280cd

Tested successful - the Option is shown in the drop down list. BUT

When using invalid xml I have 3x this error over the screen:
I have Warning: simplexml_load_file(): /joomla/testabc/templates/cassiopeia/html/com_content/article/alternatelayout.xml:9: parser error : Premature end of data in tag metadata line 2 in /Users/elisa/Development/joomla/testabc/libraries/src/Form/Field/ComponentlayoutField.php on line 216

Before applying the patch there was no such warning for the invalid xml. Maybe there is a need to catch this case?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47495.

avatar coolcat-creations
coolcat-creations - comment - 22 Aug 2026

I have tested this item ✅ successfully on bb280cd

Tested successful - the Option is shown in the drop down list. BUT

When using invalid xml I have 3x this error over the screen:
I have Warning: simplexml_load_file(): /joomla/testabc/templates/cassiopeia/html/com_content/article/alternatelayout.xml:9: parser error : Premature end of data in tag metadata line 2 in /joomla/testabc/libraries/src/Form/Field/ComponentlayoutField.php on line 216

Before applying the patch there was no such warning for the invalid xml. Maybe there is a need to catch this case?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47495.

avatar richard67 richard67 - change - 23 Aug 2026
Labels Added: Updates Requested PBF
avatar richard67 richard67 - change - 23 Aug 2026
Labels Added: bug
Removed: Updates Requested PBF
avatar richard67
richard67 - comment - 23 Aug 2026

@Divya3215 I've allowed myself to apply some code style fixes to your PR.

avatar richard67 richard67 - alter_testresult - 23 Aug 2026 - rbuelund: Tested successfully
avatar richard67 richard67 - alter_testresult - 23 Aug 2026 - coolcat-creations: Tested successfully
avatar richard67
richard67 - comment - 23 Aug 2026

I've restored the previous human tests in the issue tracker as the later commits which have invalidated the tests were just code style changes, so the tests are still valid.

avatar richard67 richard67 - change - 23 Aug 2026
Status Pending ⇒ Ready to Commit
avatar richard67
richard67 - comment - 23 Aug 2026

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47495.

avatar richard67
richard67 - comment - 23 Aug 2026

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47495.

avatar muhme muhme - change - 25 Aug 2026
Labels Added: RTC
avatar muhme
muhme - comment - 25 Aug 2026

When using invalid xml I have 3x this error over the screen: I have Warning: simplexml_load_file(): /joomla/testabc/templates/cassiopeia/html/com_content/article/alternatelayout.xml:9: parser error : Premature end of data in tag metadata line 2 in /joomla/testabc/libraries/src/Form/Field/ComponentlayoutField.php on line 216

Before applying the patch there was no such warning for the invalid xml. Maybe there is a need to catch this case?

@coolcat-creations First, thank you for testing 👍 For your finding, I would consider this a valid and clear error message for an invalid XML file, isnt it? Overrides can be dangerous! 😱 While testing for me, if the override is really working, I got 500 Layout alt_item not found and learned that I also had to copy blog_item.php as alt_item.php. Therefore, I don't think we have to (and can) catch and suppress all configuration errors.

avatar muhme
muhme - comment - 25 Aug 2026

Final test before merge with JBT on 5.4.9-dev and using MariaDB

  • Seen issue
    • Created Cassiopeia child template 'child'
    • Created override
      • Created folders mkdir -p templates/cassiopeia_child/html/com_content/category
      • Copy and rename all five needed files
        for f in .php .xml _item.php _links.php _children.php; do
          cp components/com_content/tmpl/category/blog$f templates/cassiopeia_child/html/com_content/category/alt$f
        done
      
      • Renamed layout option in alt.xml file as 'Alternative Blog'
      • Inserted echo line in alt.php file to mark the alternative layout
      • Created 'Alternative Blog' menu item
    • Seen alternative category layout working
    • Seen issue in Articles > Options > Category > Choose a Layout the alternative layout is shown with the file name alt
  • Applied PR with gh pr checkout 47495
    • ✅ child_template layout is correctly shown as 'Alternative Blog'
    • ✅ Alternative category layout is still working
    • Tested multilingual
      • Created files administrator/language/overrides/en-GB.override.ini with
      COM_CONTENT_CATEGORY_VIEW_ALT_TITLE="Alternative Blog Title"
      COM_CONTENT_CATEGORY_VIEW_ALT_OPTION="Alternative Blog Option"
      
      • Installed de-DE language and created corresponding overwrite
      • ✅ Language overrides are used correctly in Content > Articles > Options > Category > Choose a Layout for both English and German backend languages
    • Checked default layout is still working
      • Created menu item 'Default Blog' with Category Blog menu item type
        • ✅ Default category layout is used
  • ✅ No error messages in administrator/logs files
avatar muhme muhme - change - 25 Aug 2026
Status Ready to Commit ⇒ Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 ⇒ 2026-08-25 16:31:15
Closed_By ⇒ muhme
avatar muhme muhme - close - 25 Aug 2026
avatar muhme muhme - merge - 25 Aug 2026
avatar muhme
muhme - comment - 25 Aug 2026

Thank you very much @Divya3215 for your contribution. Thanks to @QuyTon and @richard67 for your support. Thanks to @rvbgnu, @rbuelund and @coolcat-creations for testing.

avatar richard67 richard67 - change - 25 Aug 2026
The description was changed
avatar richard67 richard67 - edited - 25 Aug 2026

Add a Comment

Login with GitHub to post a comment