Create a User > Radio custom field, editable in both Front an Admin.
User can switch the radio (On or Off) on their profile or by an admin.
User profile can't be saved (in both Front or Back) with an error:
Save failed with the following error: Duplicate entry '12' for key 'PRIMARY'
until field is unpublished (field has the id 12)
Joomla 3.9.11
MariaDB 10.4.7
PHP 7.2.21
Labels |
Added:
?
|
Title |
|
Labels |
Added:
J3 Issue
|
Status | New | ⇒ | Information Required |
Would be good if somebody can try reproduce the issue, because on a quick test I couldn't on a fresh Joomla installation. Does it only happen for users or is it a general radio field issue?
Can't confirm. Radio custom field is editable and can be saved in Front- and Backend as expected.
Setting | Value |
---|---|
PHP Built On | Linux lamp122.cloudaccess.net 3.10.0-962.3.2.lve1.5.24.7.el6h.x86_64 #1 SMP Mon Dec 17 12:02:35 EST 2018 x86_64 |
Database Type | mysql |
Database Version | 5.7.24-cll-lve |
Database Collation | utf8mb4_general_ci |
Database Connection Collation | utf8mb4_general_ci |
PHP Version | 7.3.8 |
Web Server | Apache |
WebServer to PHP Interface | cgi-fcgi |
Joomla! Version | Joomla! 3.9.12-dev Development [ Amani ] 12-August-2019 17:15 GMT |
Joomla! Platform Version | Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT |
User Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:69.0) Gecko/20100101 Firefox/68.0 |
Have you both tried with several users?
Because in my side, field can be saved with the first user that tries to write it, not the next ones (it produces the DUPLICATE KEY error).
Have you both tried with several users?
No, as it was not in "Steps to reproduce the issue".
I've tried it on a fresh Joomla, can't reproduce it too.
Yet, it happens on my >3K users Joomla installation.
What i don't understand is, why Joomla is trying to rewrite the same original field (id), and not trying to write a new value for that field (id) AND user (id)?
To clarify, Joomla is trying to rewrite the _fields
table instead of writing a new value inside the _fields_values
table.
Here, this is what i get when i save my custom field with the first (random) user i try to save the field.
But when i try to save it another (random) user:
And of course, nothing is write to the _fields_values
table
I've tried to truncate all _fields*
tables and restart creating the field, same result.
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-09-04 14:29:55 |
Closed_By | ⇒ | acs-ferreira |
Well, as sometimes it helps write things up to understand it, my _fields_values
table had a primary key on the field_id
so the error came from there...
Solved with a ALTER TABLE `xhtml57603_fields_values` DROP PRIMARY KEY;
@laoneo can you please comment?