? ? Success

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
7 Nov 2016

Summary of Changes

This PR adds support for inline subforms. It will be possible to define the subform as XML content directly inside the main XML file. It will behave similar to repeatable forms. How it will look like can be found in the testing instructions.

If this PR will get merged, then we can move the custom fields list to subforms.

Testing Instructions

Put the following XML code into the file administrator/components/com_content/models/forms/article.xml after line 162 (inside the basic fieldset in the attribs tag).

<field name="demo" type="subform" label="Subform" multiple="true">
	<form>
		<field name="name"
			label="Name"
			size="30" type="text" />

		<field name="value"
			label="Value"
			size="30" type="text" />
	</form>
</field>

Expected result

In the options tab should appear a sub form like:
image

Actual result

An error is show, that the form could not be loaded.

avatar laoneo laoneo - open - 7 Nov 2016
avatar laoneo laoneo - change - 7 Nov 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Nov 2016
Category Libraries
avatar laoneo laoneo - change - 7 Nov 2016
The description was changed
Labels Added: ?
avatar laoneo laoneo - edited - 7 Nov 2016
avatar laoneo
laoneo - comment - 8 Nov 2016

Calling @Fedik, does this change make sense?

avatar Fedik
Fedik - comment - 8 Nov 2016

looks as good idea ?
but the main form ignores the fields inside subform field? I had some problem with this before, they was rendered as part of the main form

avatar laoneo
laoneo - comment - 10 Nov 2016

Looks like we have then to change the XPath query then to look for fields which are not descendant of a field where the type is subform.

@Hackwar you was working recently on JForm for Joomla 4, can you help out on this?

avatar Fedik
Fedik - comment - 10 Nov 2016

actually that was a main reason why I have used an external file as source, instead of the children elements ?
it also more safe to have external file, when some extension use simpel //field XPath in his code, for whatever reason

avatar Hackwar
Hackwar - comment - 10 Nov 2016

Yes, I worked on JForm recently, but I don't really know anything about this here. Also, my changes are aimed at 4.0.

avatar Hackwar
Hackwar - comment - 10 Nov 2016

The corresponding PR would be #12414

avatar coolcat-creations
coolcat-creations - comment - 14 Nov 2016

I have tested this item successfully on 4150a57

Thank you, works like expected


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

avatar coolcat-creations coolcat-creations - test_item - 14 Nov 2016 - Tested successfully
avatar joomla-cms-bot joomla-cms-bot - change - 14 Nov 2016
Category Libraries Libraries Unit Tests
avatar laoneo
laoneo - comment - 14 Nov 2016

@Fedik I guess I solved with some updated XPath queries. The fields in the subform should not being rendered anymore in the main form and slo not overwrite some existing fields. Can you also do some testing as you are the subform master chief ?

@coolcat-creations probably you need to test it again.

avatar laoneo
laoneo - comment - 15 Nov 2016

@Fedik like my last commit?

avatar Fedik
Fedik - comment - 15 Nov 2016

yes, something like that ?
I try to test when will get some more time

avatar Fedik
Fedik - comment - 19 Nov 2016

works,
but still some issue, when you do the subform with fieldsets, then the main form rendered wrong:
screen 2016-11-19 18 01 05 752x312

I tried to test in module params.

<field name="demo" type="subform" label="Subform" multiple="true" groupByFieldset="true">
    <form>
        <fieldset name="test1" label="test1">
            <field name="name"  label="Name"  type="text" />
        </fieldset>
        <fieldset name="test2" label="test2">
            <field name="value"  label="Value" type="text" />
        </fieldset>
    </form>
</field>
avatar Fedik
Fedik - comment - 19 Nov 2016

I think that the reason is the same as was with <field> inside <field>

avatar laoneo
laoneo - comment - 22 Nov 2016

@Fedik can you please test again as I should have fixed the fieldsets in fields issue. Thanks.

avatar Fedik
Fedik - comment - 26 Nov 2016

I have tested this item successfully on 9cbc784


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

avatar Fedik Fedik - test_item - 26 Nov 2016 - Tested successfully
avatar Fedik
Fedik - comment - 26 Nov 2016

I leave this for reference #12451
will be need to check, after #12813 or #12451 will be merged

avatar laoneo
laoneo - comment - 26 Nov 2016

@coolcat-creations can you also test it again, then we can set it to RTC and are able to use subforms for custom fields.

avatar ufuk-avcu
ufuk-avcu - comment - 2 Dec 2016

I have tested this item successfully on 9cbc784

Works as expected. Thank you Allon.


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

avatar ufuk-avcu ufuk-avcu - test_item - 2 Dec 2016 - Tested successfully
avatar jeckodevelopment jeckodevelopment - change - 2 Dec 2016
Milestone Added:
Status Pending Ready to Commit
Labels
avatar jeckodevelopment
jeckodevelopment - comment - 2 Dec 2016

RTC


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

avatar jeckodevelopment jeckodevelopment - change - 2 Dec 2016
Milestone Added:
avatar rdeutz rdeutz - change - 4 Dec 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-12-04 11:05:53
Closed_By rdeutz
avatar rdeutz rdeutz - close - 4 Dec 2016
avatar rdeutz rdeutz - merge - 4 Dec 2016
avatar rdeutz rdeutz - reference | f3e8fd2 - 4 Dec 16
avatar rdeutz rdeutz - merge - 4 Dec 2016
avatar rdeutz rdeutz - close - 4 Dec 2016
avatar laoneo laoneo - head_ref_deleted - 4 Dec 2016
avatar laoneo
laoneo - comment - 4 Dec 2016

Thanks

avatar janstieler
janstieler - comment - 12 May 2018

Hi,
sorry I don't understand how I can use this now in my articles?
Have I do a corehack for this or is this also usable with the custom fields?

Add a Comment

Login with GitHub to post a comment