When Editing BREAD "Invalid Parameter number" error occured
Author: h22kCreated Dec 17, 2024Updated Dec 17, 2024
Labelspossible bug
Laravel version
11.27.2
PHP version
8.2.26
Voyager version
1.8
Database
Mariadb 10.5.26
Description
Whenever I try to edit exist BREAD, I encountered same error.
SQLSTATE[HY093]: Invalid parameter number (Connection: mysql, SQL: update data_types set details = ?, data_types.updated_at = ? where id = asc)
This is happening because DataType model class is using old mutator & casting system.
Steps to reproduce
- Create a BREAD
- Go to bread page again
- Edit bread
- Doesnt matter if you changed something, just submit
Expected behavior
Bread should have been updated normally.
Screenshots
Additional context
I edited DataType model class and turn old style mutators into new sytle and it is fixed.
I will prepare a PR about that.
Source: thedevdojo/voyager