-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[com_fields] - Creating a New field give SQL error on postgresql #13155
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:
|
@@ -28,7 +28,7 @@ | |||
label="COM_FIELDS_FIELD_GROUP_LABEL" | |||
description="COM_FIELDS_FIELD_GROUP_DESC" | |||
> | |||
<option value=""></option> | |||
<option value="0"></option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alikon Perhaps this should be changed to <option value="0">JNONE</option>
to avoid the nonsensical "0" in the field group select.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks added
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)