Issue Details (XML | Word | Printable)

Key: CRM-3099
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed/Completed
Priority: Major Major
Assignee: Kurund Jalmi
Reporter: Chris Burgess
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
CiviCRM

Batch Update by Profile -> Copy values to all rows does not support multiple checkbox fields

Created: 10/May/08 12:17 AM   Updated: 20/Dec/08 07:59 PM
Component/s: Core CiviCRM
Affects Version/s: 2.0
Fix Version/s: 2.1

Time Tracking:
Not Specified

File Attachments: 1. File BatchUpdateProfile.tpl (6 kB)
2. Text File copyValues.patch (3 kB)



 Description  « Hide
The javascript for "copy values to all rows" (copyValues function) fails with a javascript error when used on a profile containing a custom data field that has multiple checkboxes.

copyValues defined in templates/CRM/Contact/Form/Task/BatchUpdateProfile.tpl assumes the presence of a field with a name like "field[1234][custom_12]" for a contact_id 1234 and a multi-checkbox field which is custom_12. This fails with an error if the multi checkbox fields are "red", "blue", "green" then the field names will be "field[1234][custom_12][red]", etc.

One fix is to scan the first row of the table for inputs with a partial name match against "field[1234][custom_12]", then iterate through the matching inputs and copy values from there.

See also CRM-1554 (similar but relates to date fields)



 All   Comments   Work Log   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
Chris Burgess added a comment - 10/May/08 12:19 AM
Replacement template with changed copyValues which handles this case

Chris Burgess added a comment - 10/May/08 12:21 AM
patch of same

Donald A. Lobo added a comment - 11/May/08 10:40 PM

patch applied. thanx for submitting it

Kurund Jalmi added a comment - 12/Aug/08 01:22 PM
- apply this for all batch updates.

Kurund Jalmi added a comment - 13/Aug/08 04:10 PM
- Centralize js code, fixed in rev 16602.

Kiran Jagtap added a comment - 21/Aug/08 11:02 AM
Tested and Confirmed for 2.1 ( r - 16766 )

Kurund Jalmi added a comment - 20/Dec/08 07:59 PM
- fixed minor issue in patch
- verified in rev 18901.