Pending

User tests: Successful: Unsuccessful:

avatar ramalama
ramalama
24 Mar 2026

Pull Request resolves #47451.

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

Fixes wrong implementation of element removal in Form->load with overwrite=false.

Testing Instructions

  1. Install mod_demo47451_1.0.0.zip (System → Install → Extensions).
  2. Publish the new module “Demo for issue #47451 …” in any template position
    (e.g. Cassiopeia main-top), assigned to all pages.
  3. Open the site frontend.

Actual result BEFORE applying this Pull Request

Red FAIL box:

FAIL — bug #47451 present: title appears 2× in the form XML (expected 1×) and
the rendered form shows the label “Label from BASE xml (must NOT win)” — the
merge overrode the existing field in the wrong direction.

The dumped form XML contains a second <fieldset name="demo"> with a duplicate
<field name="title">.

Expected result AFTER applying this Pull Request

Green PASS box:

PASS — the existing field was kept (title appears 1× in the form XML, label:
“Label from VARIANT xml (must win)”).

The rendered fieldset shows title once with the VARIANT label, and the new
extra field from the base XML is still added correctly.

What the module does

  1. Builds a Form from a variant XML that defines the field title
    (label “Label from VARIANT xml (must win)”).
  2. Merges a base XML via $form->load($baseXml, false) that also defines
    title (label “Label from BASE xml (must NOT win)”) plus a new field extra.
    This mirrors what e.g. com_content's CategoryModel::preprocessForm() does
    after a variant form file was loaded.
  3. Checks the result and prints a green PASS or red FAIL box, the rendered
    fieldset and the resulting form XML.

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar ramalama ramalama - open - 24 Mar 2026
avatar ramalama ramalama - change - 24 Mar 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Mar 2026
Category Libraries
avatar ramalama
ramalama - comment - 24 Mar 2026

new PR instead of #47452

avatar richard67 richard67 - change - 24 Mar 2026
Title
Fix unset operation on field variable
[5.4] Fix unset operation on field variable
avatar richard67 richard67 - edited - 24 Mar 2026
avatar ramalama
ramalama - comment - 29 Jul 2026

mod_demo47451_1.0.0.zip
I created a minimal module extension to be used for testing.
I will also update testing instruction above accordingly.

avatar ramalama ramalama - change - 29 Jul 2026
The description was changed
avatar ramalama ramalama - edited - 29 Jul 2026

Add a Comment

Login with GitHub to post a comment