joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[5.4] Fix subform field dropdown showing current field (Fixes #46214)

Open aniket190705 opened this issue 1 month ago • 3 comments

Pull Request for Issue #46214.

Summary of Changes

This PR fixes an issue where a Subform field appears inside its own subfields dropdown. Selecting the Subform itself creates a recursive configuration, which breaks the edit view of any item (e.g., articles) using that field.

The fix ensures that the currently edited field is correctly detected, even inside a nested Subform context, and excluded from the dropdown options.

Testing Instructions

  1. Go to Content → Fields.
  2. Create a custom field (e.g., a Text field).
  3. Create a Subform field and add the custom field to it.
  4. Save the Subform.
  5. Edit the Subform again.
  6. Open the dropdown under Subform Options.

Actual result BEFORE applying this Pull Request

  • The Subform field appears in its own dropdown.
  • It can be selected.
  • Doing so creates a recursive configuration and breaks the edit view when used in Articles or other content.

Expected result AFTER applying this Pull Request

  • The Subform currently being edited does not appear in the dropdown.
  • Other fields continue to appear normally.
  • The Subform behaves correctly without causing recursion.

Link to documentations

  • [x] No documentation changes for docs.joomla.org needed
  • [x] No documentation changes for manual.joomla.org needed

aniket190705 avatar Dec 03 '25 18:12 aniket190705

@aniket190705 Can it be that the description of this PR and the code were generated by AI? To me it seems so.

The code add at 2 places sequences of empty lines.

Have you reviewed your PR yourself before submitting it?

And have you tested your change yourself before submitting this PR?

Our contribution guidelines say that PR authors shall test their PRs before submitting.

P.S.: As you can see all code style checks in our CI actions fail for your PR. Please check and fix. Thanks in advance.

richard67 avatar Dec 03 '25 19:12 richard67

Hi @richard67 I did use AI to help me with the PR description and to discuss a possible approach to solve the issue, but I implemented and tested the change myself locally before submitting the PR and the code worked completely fine.

I am a beginner in open source contributions, I did not know extra spaces can cause issues. I will fix the code style and push the updated commit.

I am contributing as part of my preparation for Google Summer of Code 2026, so I appreciate your guidance and feedback.

aniket190705 avatar Dec 03 '25 19:12 aniket190705

@aniket190705 Thanks for your reply. The log files of the failed CI checks will tell you what needs to be fixed on code style and how it can be fixed automatically when having a development environment with the code style check tools. Just use the links to the details for each failed check.

Thanks in advance, and have a good time and success with GSoC.

richard67 avatar Dec 03 '25 19:12 richard67

I have tested this item :white_check_mark: successfully on bf71f543fe6be079dcd672baebc2aacb783615f0

thank you, Aniket for your contribution!


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

SumCompanyInc avatar Dec 18 '25 18:12 SumCompanyInc

I have tested this item :white_check_mark: successfully on bf71f543fe6be079dcd672baebc2aacb783615f0

Tested successfully, descriptions of result before and after are accurate!


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

imejine avatar Dec 18 '25 18:12 imejine

RTC


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

richard67 avatar Dec 18 '25 18:12 richard67

I have tested this item :white_check_mark: successfully on 7e5325555e250aa1c9e9abd795deb1dc2811bd1a


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

TLWebdesign avatar Dec 20 '25 10:12 TLWebdesign

Thanks @aniket190705 for this bug fix, and @SumCompanyInc , @imejine and @TLWebdesign for testing.

richard67 avatar Dec 20 '25 10:12 richard67