Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Allow nested Subform inside a Subform Custom Field #43204

Merged
merged 7 commits into from
May 7, 2024

Conversation

AndySDH
Copy link
Contributor

@AndySDH AndySDH commented Apr 3, 2024

Summary of Changes

When creating a custom field of type Subform, you can select the child fields that you want as part of the Subform.

In the current situation, the dropdown of fields selection doesn't allow to select a Subform to be nested inside a Subform. This was probably done to avoid cluttering the interface too much if somebody wanted to do it.

But there is a legimitate use for this and somebody may want to intentionally have a nested Subform inside a Subform. I am currently having a legitimate use case where I want a Subform inside a Subform and I can't do it because of this limitation. There is no reason to have this limitation, let the user do it if they want to.

Testing Instructions

  • Go to Content -> Fields
  • Make sure you already have a bunch of created fields, as well as a Subform field already created
  • Create a new field of type Subform
  • Look at the "Fields" area to see what child fields you can include with the dropdown

Actual result BEFORE applying this Pull Request

  • A field of type subform is not in the available list of fields in the dropdown

Expected result AFTER applying this Pull Request

  • A field of type subform now is available to be selected

Link to documentations

  • No documentation changes for docs.joomla.org needed

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
@AndySDH
Copy link
Contributor Author

AndySDH commented Apr 3, 2024

@richard67 Thanks, fixed!

@regularlabs
Copy link
Contributor

Seems to do the job.
Test successful ✅

@richard67
Copy link
Member

Seems to do the job. Test successful ✅

@regularlabs Could you please mark your test result in the issue tracker? For this go to https://issues.joomla.org/tracker/joomla-cms/43204 and use the blue "Test this" button at the top left corner, then select your test result and finally submit. Thanks in advance.

@regularlabs
Copy link
Contributor

I have tested this item ✅ successfully on 041cd38


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

1 similar comment
@Quy
Copy link
Contributor

Quy commented Apr 6, 2024

I have tested this item ✅ successfully on 041cd38


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

@Quy
Copy link
Contributor

Quy commented Apr 6, 2024

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 6, 2024
@AndySDH
Copy link
Contributor Author

AndySDH commented Apr 6, 2024

Thanks guys!

@HLeithner HLeithner changed the title Allow nested Subform inside a Subform Custom Field [5.2] Allow nested Subform inside a Subform Custom Field Apr 24, 2024
@HLeithner
Copy link
Member

Is an endless loop considered here? subform1 -> subform2 -> subform1

I don't think so, so maybe we should check for recursion at some point (rendering or saving)

@AndySDH
Copy link
Contributor Author

AndySDH commented Apr 30, 2024

It's not considered, but then again, that would be the user that purposely breaks the form by doing something like that. It's not different then embedding a module inside another module which embeds the module itself, etc. I don't think we need to cover the case where the user does something dumb

@pe7er pe7er self-assigned this May 7, 2024
@pe7er pe7er enabled auto-merge (squash) May 7, 2024 09:31
@pe7er pe7er merged commit 1b337c4 into joomla:5.2-dev May 7, 2024
3 of 4 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label May 7, 2024
@pe7er
Copy link
Contributor

pe7er commented May 7, 2024

Thanks @AndySDH !

@Quy Quy added this to the Joomla! 5.2.0 milestone May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants