Environment
- CMS Version: Evolution CMS 3.5.x
- Database: SQLite
- OS/Server Environment: Windows / OSPanel
Description
An integrity constraint violation occurs when attempting to upload an image within the manager panel on an Evolution CMS installation powered by SQLite.
The application triggers an Eloquent insertion into the dxjm_s_galleries table, but the executed INSERT query only contains timestamp fields (updated_at, created_at). Because the parent column is defined as NOT NULL and lacks a database-level default value, SQLite strictly rejects the query and throws an exception.
Steps to Reproduce
- Set up an Evolution CMS 3.5.x environment using an SQLite database.
- Navigate to the Manager panel and open any resource.
- Attempt to upload an image using the built-in file/gallery uploader interface.
Actual Result
The upload fails immediately with a 500 Parse Error response:
SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: dxjm_s_galleries.parent (Connection: default, Database: D:\OSPanel\domains\test1.loc\core\database\evo.sqlite, SQL: insert into "dxjm_s_galleries" ("updated_at", "created_at") values (2026-05-21 08:12:44, 2026-05-21 08:12:44))
Screenshot
Expected Result
The image should upload successfully, and a corresponding row should be created in the database containing the appropriate relation IDs (such as parent or block) parsed from the request parameters.
Context Details
- Request URI:
/manager/sgallery/upload-file?cat=1&itemType=resource&block=1
- Triggering Code:
core/vendor/seiger/sgallery/src/Controllers/sGalleryController.php on line 135
Suggested Fix
The controller logic at line 135 utilizes a firstOrCreate() or create() method that fails to explicitly pass the required attributes into the instantiation array. To ensure full compatibility with SQLite's strict null constraints, either the missing required parameters (like parent) must be explicitly passed during the Eloquent creation phase, or the database migration schema should be adjusted to include a default value (e.g., ->default(0)) for the parent column.
Environment
Description
An integrity constraint violation occurs when attempting to upload an image within the manager panel on an Evolution CMS installation powered by SQLite.
The application triggers an Eloquent insertion into the
dxjm_s_galleriestable, but the executedINSERTquery only contains timestamp fields (updated_at,created_at). Because theparentcolumn is defined asNOT NULLand lacks a database-level default value, SQLite strictly rejects the query and throws an exception.Steps to Reproduce
Actual Result
The upload fails immediately with a
500 Parse Errorresponse:Screenshot
Expected Result
The image should upload successfully, and a corresponding row should be created in the database containing the appropriate relation IDs (such as
parentorblock) parsed from the request parameters.Context Details
/manager/sgallery/upload-file?cat=1&itemType=resource&block=1core/vendor/seiger/sgallery/src/Controllers/sGalleryController.phpon line 135Suggested Fix
The controller logic at line 135 utilizes a
firstOrCreate()orcreate()method that fails to explicitly pass the required attributes into the instantiation array. To ensure full compatibility with SQLite's strict null constraints, either the missing required parameters (likeparent) must be explicitly passed during the Eloquent creation phase, or the database migration schema should be adjusted to include a default value (e.g.,->default(0)) for theparentcolumn.