Skip to content
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

Merged
merged 3 commits into from
Dec 21, 2016
Merged

[com_fields] - Creating a New field give SQL error on postgresql #13155

merged 3 commits into from
Dec 21, 2016

Conversation

alikon
Copy link
Contributor

@alikon alikon commented Dec 10, 2016

Pull Request for Issue #13137 .

Summary of Changes

add a check for group_id

Testing Instructions

Create a new field see #13137 (comment)

Postgres: Inserting an image field fails with an error #13137
@Bakual
Copy link
Contributor

Bakual commented Dec 10, 2016

@laoneo
Copy link
Member

laoneo commented Dec 12, 2016

I would also put it into the XML and for safety, define the 0 as default value.

@alikon
Copy link
Contributor Author

alikon commented Dec 12, 2016

Ok I'll add the XML part

xml default
@alikon
Copy link
Contributor Author

alikon commented Dec 13, 2016

xml deafult added

@laoneo
Copy link
Member

laoneo commented Dec 14, 2016

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.

@Bakual
Copy link
Contributor

Bakual commented Dec 14, 2016

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.

@alikon
Copy link
Contributor Author

alikon commented Dec 14, 2016

At least we have this already fixed for j4 where mysql should be in strict mode ;)

@waader
Copy link
Contributor

waader commented Dec 15, 2016

I have tested this item ✅ successfully on 335026a

The error has gone. Thanks alikon!

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>
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks added

added JNONE
@ralain
Copy link
Contributor

ralain commented Dec 21, 2016

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.

@zero-24 zero-24 added this to the Joomla 3.7.0 milestone Dec 21, 2016
@zero-24 zero-24 merged commit c0036f2 into joomla:staging Dec 21, 2016
@zero-24
Copy link
Contributor

zero-24 commented Dec 21, 2016

Merged thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants