Auto Action to add record prepopulates with data

Post Reply
antevasin
Posts: 121
Joined: 24 Mar 2020, 08:57
Name: Spencer Crocker
Location: Corby, UK
Company Name: Unicloud
Contact:

Auto Action to add record prepopulates with data

Post 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
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Auto Action to add record prepopulates with data

Post 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
antevasin
Posts: 121
Joined: 24 Mar 2020, 08:57
Name: Spencer Crocker
Location: Corby, UK
Company Name: Unicloud
Contact:

Re: Auto Action to add record prepopulates with data

Post by antevasin »

Thanks Sergey!
antevasin
Posts: 121
Joined: 24 Mar 2020, 08:57
Name: Spencer Crocker
Location: Corby, UK
Company Name: Unicloud
Contact:

Re: Auto Action to add record prepopulates with data

Post 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;
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Auto Action to add record prepopulates with data

Post 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.
Attachments
img2.png
antevasin
Posts: 121
Joined: 24 Mar 2020, 08:57
Name: Spencer Crocker
Location: Corby, UK
Company Name: Unicloud
Contact:

Re: Auto Action to add record prepopulates with data

Post 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
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Auto Action to add record prepopulates with data

Post by support »

Found issue. File from archive replace to modules\items\views\
Let me know if it works ok now.
Attachments
processes.zip
(7.43 KiB) Downloaded 39 times
Post Reply