No Code Attached Yet bug
avatar muba4
muba4
29 Apr 2022

Is your feature request related to a problem? Please describe.

In Joomla 4.1.2 all the bug width Subform.

Including a form field in the (content) plugin:

public function onContentPrepareForm(Form $form, $data)
	{
...
		$form->load('
			<form>
				<field
					name="fulltextTTT"
					type="subform"
					label="FIELD_SITE_VIDEO_YOUTUBE_QUEST"
					multiple="true"
					min="1"
					max="444"
					buttons="add,remove"
					layout="joomla.form.field.subform.repeatable"
					>
					<form>
						<field
							name="quest"
							type="text"
							label="Тут текст метки quest"
							filter="JComponentHelper::filterText"
						/>
						<field
							name="responses"
							type="subform"
							label="FIELD_SITE_VIDEO_YOUTUBE_ANSWERS"
							multiple="true"
							min="2"
							max="444"
							buttons="add,remove"
							layout="joomla.form.field.subform.repeatable-table"
							>
							<form>
								<field
									name="answer"
									type="text"
									label="Тут текст метки answer"
									filter="JComponentHelper::filterText"
								/>
							</form>
						</field>
					</form>
				</field>
			</form>'
		);
...

Inserting a form field in a template:
templates\my-template\html\com_content\form\layer-name.php

...
				<?php /* вставка поля с Викториной */ ?>
				<?php echo $this->form->renderField('fulltextTTT'); ?>
				<?php /* конец вставки поля с Викториной */ ?>

Received data:

Array
(
    [fulltextTTT0] => Array
        (
            [quest] => quest 1
            [responses] => Array
                (
                    [responses0] => Array
                        (
                            [answer] => answer 1/1
                        )

                    [responses1] => Array
                        (
                            [answer] => answer 1/2
                        )

                )

        )

    [fulltextTTT1] => Array
        (
            [quest] => quest 2
            [responses] => Array
                (
                )

        )

    [fulltextTTTX] => Array
        (
            [responses] => Array
                (
                    [responses0] => Array
                        (
                            [answer] => answer 2/1
                        )

                    [responses1] => Array
                        (
                            [answer] => answer 2/2
                        )

                )

        )

)

Form view:
image

Describe the solution you'd like

Data that must be sent by the form::

Array
(
    [fulltextTTT0] => Array
        (
            [quest] => quest 1
            [responses] => Array
                (
                    [responses0] => Array
                        (
                            [answer] => answer 1/1
                        )

                    [responses1] => Array
                        (
                            [answer] => answer 1/2
                        )

                )

        )

    [fulltextTTT1] => Array
        (
            [quest] => quest 2
            [responses] => Array
                (
                    [responses0] => Array
                        (
                            [answer] => answer 2/1
                        )

                    [responses1] => Array
                        (
                            [answer] => answer 2/2
                        )

                )

        )

)

Additional context

PHP Built On Linux lb8 4.19.0-18-amd64 #1 SMP Debian 4.19.208-1 (2021-09-29) x86_64
Database Type mysql
Database Version 10.3.34-MariaDB-0+deb10u1
Database Collation utf8mb4_general_ci
Database Connection Collation utf8mb4_general_ci
Database Connection Encryption None
Database Server Supports Connection Encryption No
PHP Version 8.0.18
Web Server nginx/1.21.6
WebServer to PHP Interface fpm-fcgi
Joomla! Version Joomla! 4.1.2 Stable [ Kuamini ] 30-March-2022 16:00 GMT

avatar muba4 muba4 - open - 29 Apr 2022
avatar joomla-cms-bot joomla-cms-bot - change - 29 Apr 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Apr 2022
avatar muba4 muba4 - change - 29 Apr 2022
The description was changed
avatar muba4 muba4 - edited - 29 Apr 2022
avatar muba4 muba4 - change - 29 Apr 2022
The description was changed
avatar muba4 muba4 - edited - 29 Apr 2022
avatar muba4 muba4 - change - 29 Apr 2022
The description was changed
avatar muba4 muba4 - edited - 29 Apr 2022
avatar muba4 muba4 - change - 29 Apr 2022
The description was changed
avatar muba4 muba4 - edited - 29 Apr 2022
avatar muba4
muba4 - comment - 29 Apr 2022

PHP Version 7.4.29
Doesn't work correctly either.

avatar muba4 muba4 - change - 7 May 2022
Title
Subform incorrectly builds new (repeated) fields
[4.2] Subform incorrectly builds new (repeated) fields
avatar muba4 muba4 - edited - 7 May 2022
avatar muba4 muba4 - change - 7 May 2022
Title
[4.2] Subform incorrectly builds new (repeated) fields
[4.1] Subform incorrectly builds new (repeated) fields
avatar muba4 muba4 - edited - 7 May 2022
avatar muba4
muba4 - comment - 11 May 2022

Upgrade to Joomla Joomla 4.1.3.
Subforms error has not been fixed.

avatar muba4
muba4 - comment - 18 May 2022

The error is localized.

The problem is that when the second nested field template is created, the minimum number of nested fields is specified.

Here it is:

						<field
							name="responses"
							type="subform"
							label="FIELD_SITE_VIDEO_YOUTUBE_ANSWERS"
							multiple="true"
							min="2" <!------------------------------------- It's not working! -->
							max="444"
							buttons="add,remove"
							layout="joomla.form.field.subform.repeatable-table"
							>
avatar muba4 muba4 - change - 18 May 2022
The description was changed
avatar muba4 muba4 - edited - 18 May 2022
avatar chmst chmst - change - 17 Feb 2023
Labels Added: bug
avatar chmst chmst - labeled - 17 Feb 2023

Add a Comment

Login with GitHub to post a comment