[com_fields] - Creating a New field give SQL error on postgresql#13155
[com_fields] - Creating a New field give SQL error on postgresql#13155zero-24 merged 3 commits intojoomla:stagingfrom alikon:patch-82
Conversation
Postgres: Inserting an image field fails with an error #13137
|
We could also specify the option value as 0 in https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_fields/models/forms/field.xml#L31 |
|
I would also put it into the XML and for safety, define the 0 as default value. |
|
Ok I'll add the XML part |
xml default
|
xml deafult added |
|
Should the different installer scripts not be coherent to each other. In MySQL we default the value to 0 https://github.com/joomla/joomla-cms/blob/staging/installation/sql/mysql/joomla.sql#L643. |
|
The issue is that PostgreSQL works differently (more strict) than MySQL. The default is defined as 0 in PostgreSQL as well (see https://github.com/joomla/joomla-cms/blob/staging/installation/sql/postgresql/joomla.sql#L656) but we try to store an empty string there. MySQL just changes the invalid value to the default. PostgreSQL rightfully rejects it as an invalid value and throws an error. |
|
At least we have this already fixed for j4 where mysql should be in strict mode ;) |
|
I have tested this item ✅ successfully on 335026a Two things I noticed:
|
| description="COM_FIELDS_FIELD_GROUP_DESC" | ||
| > | ||
| <option value=""></option> | ||
| <option value="0"></option> |
There was a problem hiding this comment.
@alikon Perhaps this should be changed to <option value="0">JNONE</option> to avoid the nonsensical "0" in the field group select.
added JNONE
|
I have tested this item ✅ successfully on ae96b42 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13155. |
|
Merged thanks! |
Pull Request for Issue #13137 .
Summary of Changes
add a check for group_id
Testing Instructions
Create a new field see #13137 (comment)