Page 1 of 1

Auto Action to add record prepopulates with data

Posted: 15 Aug 2023, 12:48
by antevasin
I have replicated the issue in the following demo https://pdemo.rukovoditel.pro/3.4/index ... mo_id=2338
Bug is as follows.
If you go to this record https://pdemo.rukovoditel.pro/3.4/index ... mo_id=2338
and then click on Add Training Record button on right hand Training Record portlet the Title field prepopulates with the text 'Training Record 4'. Because you are on 27-4 trying to add a record to entity 88 it is prepopulating with the field value from the record 88-4
If you click on the same Add Training Record button in this record https://pdemo.rukovoditel.pro/3.4/index ... mo_id=2338 the Title field is blank as you would expect. This is because there is no 88-5 record to get any value from.
Not behaviour you would expect.
Thanks

Re: Auto Action to add record prepopulates with data

Posted: 16 Aug 2023, 10:09
by support
This issue is fixed in version 3.4.3. Please update.
Demo already updated and you can check it here https://pdemo.rukovoditel.pro/3.4/index ... mo_id=2338

Re: Auto Action to add record prepopulates with data

Posted: 17 Aug 2023, 11:57
by antevasin
Thanks Sergey!

Re: Auto Action to add record prepopulates with data

Posted: 22 Jan 2024, 22:54
by antevasin
Hi Sergey, just realised that this isn't completely fixed in 3.5.
If the fields in the auto action are on a tab then they will still prepopulate as before.
I have replicated this in the following demo page
https://pdemo.rukovoditel.pro/3.4/index ... mo_id=2809
and
https://pdemo.rukovoditel.pro/3.4/index ... mo_id=2809
If you click on the auto action button Bug - Add Task then the form will load and prepoopulate with the value from task that is the same as the parent item id of the item you are on.

Line 343 in modules/items/views/processes.php is the issue as it returns true

Code: Select all

if($process_form->is_field_in_tab($fields['id'])) continue;

Re: Auto Action to add record prepopulates with data

Posted: 23 Jan 2024, 13:56
by support
This is not bug. Tab will be hidden if there is only one tab. If you will add second one, then tabs will be displays.

Re: Auto Action to add record prepopulates with data

Posted: 23 Jan 2024, 14:21
by antevasin
The issue is that when you click on the Bug - Add Task auto action button in the demo it pre-populates with a value. It should be blank as that is what the auto action is for.
You are adding a new item not editing one.
If you click on the same button here it clears the form
https://pdemo.rukovoditel.pro/3.4/index ... mo_id=2809

Re: Auto Action to add record prepopulates with data

Posted: 24 Jan 2024, 10:06
by support
Found issue. File from archive replace to modules\items\views\
Let me know if it works ok now.