-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG Creating Person Custom Fields in 2.4.3 #1598
Comments
I added 3 custom fields. When I try update a person's data i get the folow error from Cannot execute query. |
I verified that, when I imported data, the same data was imported in the 3 custom fields. Example: I created 3 custom fields as baptism date, id number and second mobile number. When i imported data, the 3 fields was filled with id number. |
Same issue here, fresh install of 2.4.3. The custom fields manager query isn't incrementing the identity number 'c1' for new custom fields, so basically the ALTER query is trying to create a new field with the same primary ID as the last one. I'm just starting to look into the problem now (brand new to this code, so it may take me a bit!), but I suspect something's wrong around line 124 and following in PersonCustomFieldsEditor.php, which starts:
|
Error is in line 128 of PersonCustomFieldsEditor.php, which calls mysqli_num_fields() to calculate $last:
Where it should be mysqli_num_rows() instead:
I had noticed that this error not appear when adding custom family fields, so compared the code at line 168 of FamilyCustomFieldsEditor.php, and spotted the difference. |
It looks like the equivalent problem with family custom fields was fixed on Nov 18 by @crossan007 with commit 58bf29f, but this problem was missed in commit 2732d5e on the same day. |
When I add the second custom field I get the folow message:
"Can not execute query.
ALTER TABLE person_custom ADD c1 VARCHAR (30) DEFAULT NULL; "
If I press F5, the field appears correctly created. But, when I try to create third field, I get the message:
Can not execute query.
ALTER TABLE person_custom ADD c1 TINYINT (4) DEFAULT NULL;
And so on
With more tries, types and names are mixed.
The text was updated successfully, but these errors were encountered: