? Pending

User tests: Successful: Unsuccessful:

avatar muba4
muba4
6 Oct 2021

Nesteds subform

В строке 68 надо суффикс у имени поля поменять с 'X' на '0'.
Тогда вложенные subform (одна в другую) начинают формировать нормальный JSON для записи в БД.

I'm sorry for my English. =D

Pull Request for Issue # .

Summary of Changes

Testing Instructions

Actual result BEFORE applying this Pull Request

Expected result AFTER applying this Pull Request

Documentation Changes Required

avatar muba4 muba4 - open - 6 Oct 2021
avatar muba4 muba4 - change - 6 Oct 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Oct 2021
Category Layout
avatar brianteeman
brianteeman - comment - 6 Oct 2021

google translation

On line 68, change the field name suffix from 'X' to '0'.
Then the nested subforms (one within the other) begin to form normal JSON for writing to the database.

avatar muba4
muba4 - comment - 6 Oct 2021

Simple Joomla 4 plugin (for test).
https://disk.yandex.ru/d/hi6n5Xu4-r7_zQ

See tab "Publishing" (down in fieldset "Metadata") by Article creation or edition.

avatar Fedik
Fedik - comment - 7 Oct 2021

You have to explain what you tries to fix, your original issue.

The changes here is wrong. And cannot be accepted.

avatar muba4
muba4 - comment - 7 Oct 2021

You have to explain what you tries to fix, your original issue.

Try installing the plugin. Link above.

Without the suggested fixes, nested subforms are not correctly stored in the database. As a result, they cannot be used.

I can copy the plugin code here, but there will be a lot of code.

Copy it?

avatar Fedik
Fedik - comment - 7 Oct 2021

No need whole plugin, enough just XML for subform.

But, I think you talking about this #35721 issue.
It was already fixed, you have to wait for 4.0.4

avatar muba4
muba4 - comment - 7 Oct 2021

No need whole plugin, enough just XML for subform.

main.xml

<?xml version="1.0" encoding="UTF-8"?>
<form>
	<fields name="metadata">
		<fieldset name="jmetadata">
			<field
				name="quest"
				type="subform"
				label="Поле quest"
				description="Описание поля quest"
				multiple="true"
				buttons="add,remove"
				layout="joomla.form.field.subform.repeatable"
				formsource="/plugins/content/metatitle/subforms/guestions.xml"
				/>
		</fieldset>
	</fields>
</form>

guestions.xml

<?xml version="1.0" encoding="UTF-8"?>
				<form>
					<field name="question" type="textarea" cols="40" rows="8" label="Вопрос:" />
					<field
							name="answers"
							type="subform"
							label="Поле answers"
							description="Описание поля answers"
							multiple="true"
							buttons="add,remove"
							min="3"
							layout="joomla.form.field.subform.repeatable"
							formsource="/plugins/content/metatitle/subforms/answers.xml"
						/>
				</form>

answers.xml

<?xml version="1.0" encoding="UTF-8"?>
						<form>
							<field
								name="answer"
								type="text"
								label="Ответ:"
								description="Описание поля answer" />
						</form>
avatar Fedik
Fedik - comment - 7 Oct 2021

yeah, well, I think it the same as #35721
and it already fixed,

You can try to test on latest 4.0-dev branch, or using nightly-builds https://developer.joomla.org/nightly-builds.html

avatar Fedik
Fedik - comment - 7 Oct 2021

Closed in reason stated above. Thanks for PR.

avatar Fedik Fedik - change - 7 Oct 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-10-07 12:25:40
Closed_By Fedik
Labels Added: ?
avatar Fedik Fedik - close - 7 Oct 2021
avatar muba4
muba4 - comment - 7 Oct 2021

Don't work.

Before test:

  1. Update Joomla from 4.0.3 to Joomla ‎4.0.4-dev‎4.0.4-dev (https://developer.joomla.org/nightlies/Joomla_4.0.3_to_4.0.4-dev-Development-Patch_Package.zip)
  2. Updated plugin: https://disk.yandex.ru/d/tgSogz6hF6AjZA
    main.xml
<?xml version="1.0" encoding="UTF-8"?>
<form>
	<fields name="metadata">
		<fieldset name="jmetadata">
<!-- new code from: https://github.com/joomla/joomla-cms/pull/35726#issue-1014053544 -->
<field
        name="subform_parent"
        label="Subform Parent"
        type="subform"
        multiple="true"
        buttons="add,remove"
>
    <form>
        <field
                name="test_text"
                label="Test Text"
                type="text"
        />
        <field
                name="child_subform"
                label="Child Subform"
                type="subform"
                multiple="true"
        >
            <form>
                <field
                        name="child_text"
                        label="Child Field"
                        type="text"
                />
            </form>
        </field>
    </form>
</field>
<!-- end new code -->
		</fieldset>
	</fields>
</form>
  1. before Test: (Ctrl + F5 - for browser cash clean an Article Edit and/or New Page)

image
5.
image

Пичалька =(

avatar Fedik
Fedik - comment - 8 Oct 2021

Test with Full_Package.
In some reason Patch_Package is incomplete.

avatar muba4
muba4 - comment - 8 Oct 2021

Test with Full_Package.

It's work! =)

Спасибо! ))

Add a Comment

Login with GitHub to post a comment