Bug #5078
openValues for additional user fields are shared across all users (Chamilo 2.1 stable)
0%
Description
This is a bug encountered in Chamilo 2.1 (stable)
Prerequisites:
Have two separate users accounts ready in Chamilo.
Steps to reproduce:
1. Build a new user field (Administration -> User -> Build user fields). A textbox field is easiest for testing.
2. Log in with one user account, go to 'My account -> AdditionalAccountInformationTitle' and set a value for the additional field.
3. Log in with another user account and go to 'My account -> AdditionalAccountInformationTitle'. You'll notice that the value stored for user A is displayed here. Assign a different value to the additional field.
4. Log in with the first user again and go to 'My account -> AdditionalAccountInformationTitle'. The value stored by the other user account is now shown here.
Further info:
The table responsible for storing this information contains just one record after going though the steps listed above:
mysql> select * from admin_dynamic_form_element_value; +----+---------+------------+-------------------------+---------+ | id | user_id | time | dynamic_form_element_id | value | +----+---------+------------+-------------------------+---------+ | 4 | 6 | 1340866043 | B | value A | +----+---------+------------+-------------------------+---------+ 1 row in set (0.00 sec)
This bug has 2 causes:
1. Before storing the value for this field, records from the admin_dynamic_form_element_value table matching a given dynamic_form_element_id are deleted before they are inserted again. The user_id column is not taken into account, so records for all users are deleted.
2. When retrieving the current value for the additional field from the admin_dynamic_form_element_value table, the user_id is again not taken into account.
Proposed solution:
Apply the attached additional-user-fields.patch file to the chamilo stable repository. This will update the common/extensions/dynamic_form_manager/php/dynamic_form_execute_form.class.php file with the, in my mind, necessary changes.
Files
Updated by Bram Thielemans almost 11 years ago
The MySQL table posted initially is incorrect. Something messed up when copying. Here's a correct version:
+----+---------+------------+-------------------------+---------+ | id | user_id | time | dynamic_form_element_id | value | +----+---------+------------+-------------------------+---------+ | 5 | 6 | 1340869265 | 1 | value B | +----+---------+------------+-------------------------+---------+
Updated by Stefaan Vanbillemont almost 11 years ago
- Target version set to Backlog (default)