I have a custom field colors for the RM with a lot of checkboxes. I save integers.
1 blue
2 red
3 green
4 orange
Now i want to bring the half of this values to another field. So i have added a new field colors2 with
3 green
4 orange
With a script i fetch all resource_id, field_value WHERE field_id = color FROM xf_rm_resource_field_value
unserialize => field_value
Then i make a check with allowed numbers (3, 4) and finally i have an array like
temp = [
3=> "3",
4=> "4"
]
serialize and UPDATE field_value to xf_rm_resource_field_value WHERE field_id = color2 and resource_id = resource_id FROM the first query.
The result looks exactly like it should;
example:
a:6:{i:72;s:2:"72";i:26;s:2:"26";i:38;s:2:"38";i:50;s:2:"50";i:142;s:3:"142";i:141;s:3:"141";}
And this is the same resource_id after i have clicked the checkboxes.
a:6:{i:72;s:2:"72";i:26;s:2:"26";i:38;s:2:"38";i:50;s:2:"50";i:142;s:3:"142";i:141;s:3:"141";}
There is no difference, but after clicking RM shows me the field_values,
while he doesnt show them, when i update the fields by script.
Is there anything else, i have forgotten to do?
1 blue
2 red
3 green
4 orange
Now i want to bring the half of this values to another field. So i have added a new field colors2 with
3 green
4 orange
With a script i fetch all resource_id, field_value WHERE field_id = color FROM xf_rm_resource_field_value
unserialize => field_value
Then i make a check with allowed numbers (3, 4) and finally i have an array like
temp = [
3=> "3",
4=> "4"
]
serialize and UPDATE field_value to xf_rm_resource_field_value WHERE field_id = color2 and resource_id = resource_id FROM the first query.
The result looks exactly like it should;
example:
a:6:{i:72;s:2:"72";i:26;s:2:"26";i:38;s:2:"38";i:50;s:2:"50";i:142;s:3:"142";i:141;s:3:"141";}
And this is the same resource_id after i have clicked the checkboxes.
a:6:{i:72;s:2:"72";i:26;s:2:"26";i:38;s:2:"38";i:50;s:2:"50";i:142;s:3:"142";i:141;s:3:"141";}
There is no difference, but after clicking RM shows me the field_values,
while he doesnt show them, when i update the fields by script.
Is there anything else, i have forgotten to do?