No Code Attached Yet
avatar coolcat-creations
coolcat-creations
30 Sep 2024

Steps to reproduce the issue

When I try to save this nested subform, the entries are saved but still I get the error:

Save failed with the following error: Field 'value' doesn't have a default value
grafik

grafik

If I disable the nested subform no error appears.

Expected result

no error

System information (as much as possible)

The currently installed Joomla! version is "‎5.2.0-rc1-dev" ‎5.2.0-rc1-dev

avatar coolcat-creations coolcat-creations - open - 30 Sep 2024
avatar joomla-cms-bot joomla-cms-bot - change - 30 Sep 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 30 Sep 2024
avatar brianteeman
brianteeman - comment - 30 Sep 2024

From the information provided I could not replicate the error

avatar coolcat-creations
coolcat-creations - comment - 30 Sep 2024

Maybe because I updated the site with an update package ? No clean installation...
Not sure how to debug.

avatar coolcat-creations
coolcat-creations - comment - 30 Sep 2024

I tested it on another site I upgraded from 5.1.4 to 5.2 nightly build and same:
The error appears when data is added into the nested subform (in my case the grid items)

grafik
avatar brianteeman
brianteeman - comment - 30 Sep 2024

are you sure the problem isnt from the first field where you have not selected an item?

avatar coolcat-creations
coolcat-creations - comment - 30 Sep 2024

Yes because if I leave the "grid" fields empty the error does not appear and because in my first testing site no other fields exist.

avatar hayyi
hayyi - comment - 30 Sep 2024

I encountered the same error, but resolved it by changing my database column from non-nullable to nullable, which made the error disappear. I'm not sure if this is related to your issue, but it might be worth checking your database for the stored value

avatar coolcat-creations
coolcat-creations - comment - 30 Sep 2024

Ok but thats a fresh install of 5.1.4 + Update to RC1, not sure sending the users to the database is a good user experience. Maybe this set to Nullable could be implemented in the update?

avatar brianteeman
brianteeman - comment - 30 Sep 2024

It should be NULL by default

avatar coolcat-creations
coolcat-creations - comment - 30 Sep 2024

I confirm it was NULL

avatar brianteeman
brianteeman - comment - 30 Sep 2024

So it is nothing to do with that then

avatar coolcat-creations
coolcat-creations - comment - 30 Sep 2024

Agree, but the error is there anyway.

avatar coolcat-creations
coolcat-creations - comment - 3 Oct 2024

Updated to RC1 and issue still exist

avatar brianteeman
brianteeman - comment - 4 Oct 2024

From the information provided I could not replicate the error

Maybe if you provided more details on the exact setup of the fields someone will be able to help you. As it is right now, based on the limited information in your screenshots I still cannot replicate this.

avatar coolcat-creations coolcat-creations - change - 4 Oct 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-10-04 08:49:19
Closed_By coolcat-creations
avatar coolcat-creations coolcat-creations - close - 4 Oct 2024
avatar coolcat-creations
coolcat-creations - comment - 4 Oct 2024

It seems it was an issue with the nightly build package,
I installed again a new 5.1.4 made an update to 5.2 RC1 and the issue did not appear anymore.
now I installed again a new 5.1.4 made an update by uploading the folder into the joomla update component to make sure I did the same like in the failed ones and the issue did not appear. Closing.

avatar coolcat-creations coolcat-creations - change - 5 Nov 2024
Status Closed New
Closed_Date 2024-10-04 08:49:19
Closed_By coolcat-creations
avatar coolcat-creations coolcat-creations - reopen - 5 Nov 2024
avatar coolcat-creations
coolcat-creations - comment - 5 Nov 2024

I have to reopen this again because I have the same Error on a fresh install of Joomla 5.2

avatar richard67
richard67 - comment - 5 Nov 2024

The error message refers to a value not being given for a database column with name "value" in an "INSERT" SQL statement and that database column does not have a DEFAULT value in the database structure so the value HAS to be specified when inserting data.

It's very likely the "value" column of the "#__fields_values" table, and for that column we do not specify a default value by purpose here: https://github.com/joomla/joomla-cms/blob/5.2-dev/installation/sql/mysql/supports.sql#L226

The reason why we do not specify a default value is because that is not allowed on MySQL 8, see here: https://dev.mysql.com/doc/refman/8.4/en/blob.html

BLOB and TEXT columns cannot have DEFAULT values.

The "TEXT" refers to data types "TINYTEXT", "TEXT", "MEDIUMTEXT", and "LONGTEXT", so for CHAR or VARCHAR columns we still can use DEFAULT values.

See also PR #27937 which removed the DEFAULT values from such column so Joomla works on MySQL 8-

Even if you could change the database to have a DEFAULT value for such a column when you are on MariaDB, we cannot do that because we do not have different data structures for MySQL and MariaDB.

So the database is as it should be, and the error must be in some PHP code which does the "INSERT" into that table without specifying a value for that column (even NULL would be ok as value).

@Fedik As you know much about our subforms: Do you have an idea where that could go wrong? Maybe something with a TABLE class removing all columns from the insert statement when it has a NULL value? Could that be related to what you handle with your PR #43905 ?

avatar Fedik
Fedik - comment - 5 Nov 2024

It is more likely after we allowed the nested form for Subform Custom field #43204

The Subform itself has an issue with handling nested form which have a default value or min attribute, #43652

Make sure your nested subform does not have these attributes.

avatar coolcat-creations coolcat-creations - close - 6 Nov 2024
avatar coolcat-creations
coolcat-creations - comment - 6 Nov 2024

Closing again since its an issue with jfilters.

avatar coolcat-creations coolcat-creations - change - 6 Nov 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-11-06 10:21:50
Closed_By coolcat-creations

Add a Comment

Login with GitHub to post a comment