Affected version: 3.7.3
Database: PostgreSQL 15
Bug: app/Domain/Wiki/Repositories/Wiki.php line ~187 (in createArticle):
$id = $this->dbConnection->table('zp_canvas_items')->insertGetId([
...
'sortIndex' => '10', // <-- camelCase
]);
But the schema (SchemaBuilder.php line 173: $table->integer('sortindex')) and every other reference to this column uses lowercase:
Wiki.php itself elsewhere: ->select(... 'sortindex', ...), $article->sortindex = $row->sortindex
Canvas/Repositories/Canvas.php: 'zp_canvas_items.sortindex'
Goalcanvas/Repositories/Goalcanvas.php: 'zp_canvas_items.sortindex'
Tickets/Repositories/Tickets.php: ->orderBy('zp_tickets.sortindex', 'ASC')
Projects/Services/Projects.php: 'sortindex' => $item['sortindex']
Ideas/Repositories/Ideas.php: ['sortindex' => (int) $idea['sortIndex']]
MySQL is case-insensitive on column identifiers → the INSERT works. Postgres quotes-and-preserves-case → column "sortIndex" of relation "zp_canvas_items" does not exist on first article creation.
Proposed fix: One-character change at line 187: 'sortIndex' → 'sortindex'.
Affected version: 3.7.3
Database: PostgreSQL 15
Bug: app/Domain/Wiki/Repositories/Wiki.php line ~187 (in createArticle):
$id = $this->dbConnection->table('zp_canvas_items')->insertGetId([
...
'sortIndex' => '10', // <-- camelCase
]);
But the schema (SchemaBuilder.php line 173: $table->integer('sortindex')) and every other reference to this column uses lowercase:
Wiki.php itself elsewhere: ->select(... 'sortindex', ...), $article->sortindex = $row->sortindex
Canvas/Repositories/Canvas.php: 'zp_canvas_items.sortindex'
Goalcanvas/Repositories/Goalcanvas.php: 'zp_canvas_items.sortindex'
Tickets/Repositories/Tickets.php: ->orderBy('zp_tickets.sortindex', 'ASC')
Projects/Services/Projects.php: 'sortindex' => $item['sortindex']
Ideas/Repositories/Ideas.php: ['sortindex' => (int) $idea['sortIndex']]
MySQL is case-insensitive on column identifiers → the INSERT works. Postgres quotes-and-preserves-case → column "sortIndex" of relation "zp_canvas_items" does not exist on first article creation.
Proposed fix: One-character change at line 187: 'sortIndex' → 'sortindex'.