Skip to content

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

Merged
zero-24 merged 3 commits intojoomla:stagingfrom
alikon:patch-82
Dec 21, 2016
Merged

[com_fields] - Creating a New field give SQL error on postgresql#13155
zero-24 merged 3 commits intojoomla:stagingfrom
alikon:patch-82

Conversation

@alikon
Copy link
Copy Markdown
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
Copy Markdown
Contributor

Bakual commented Dec 10, 2016

@laoneo
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

alikon commented Dec 12, 2016

Ok I'll add the XML part

xml default
@alikon
Copy link
Copy Markdown
Contributor Author

alikon commented Dec 13, 2016

xml deafult added

@laoneo
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

waader commented Dec 15, 2016

I have tested this item ✅ successfully on 335026a

The error has gone. Thanks alikon!

Two things I noticed:

description="COM_FIELDS_FIELD_GROUP_DESC"
>
<option value=""></option>
<option value="0"></option>
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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