I’m getting the error below while using a mysql/mariadb view as table:
// mysql view "table"
$crud->setTable('view_name');
// "primary key" on view
$crud->setPrimaryKey('id', 'view_name');
I know Johnny that you’ve corrected this bug previously for the ‘add’, ‘edit’ and ‘delete’ operations. Could you please apply the same patch to ‘read’?
TIA.
Bernhard Enders
CRITICAL - 2023-07-26 16:22:57 --> Trying to access array offset on value of type null
in VENDORPATH\grocery-crud\enterprise\src\GroceryCrud\Core\Model.php on line 320.
1 VENDORPATH\grocery-crud\enterprise\src\GroceryCrud\Core\Model.php(320): CodeIgniter\Debug\Exceptions->errorHandler()
2 VENDORPATH\grocery-crud\enterprise\src\GroceryCrud\Core\Model.php(295): GroceryCrud\Core\Model->_getPrimaryKey()
3 VENDORPATH\grocery-crud\enterprise\src\GroceryCrud\Core\State\StateAbstract.php(1214): GroceryCrud\Core\Model->getPrimaryKeyField()
4 VENDORPATH\grocery-crud\enterprise\src\GroceryCrud\Core\State\ReadFormState.php(34): GroceryCrud\Core\State\StateAbstract->getPrimaryKeyName()
5 VENDORPATH\grocery-crud\enterprise\src\GroceryCrud\Core\State\ReadFormState.php(53): GroceryCrud\Core\State\ReadFormState->initialize()
6 VENDORPATH\grocery-crud\enterprise\src\GroceryCrud\Core\GroceryCrud.php(2867): GroceryCrud\Core\State\ReadFormState->render()
7 APPPATH\Controllers\Admin\Users.php(162): GroceryCrud\Core\GroceryCrud->render()
8 SYSTEMPATH\CodeIgniter.php(932): App\Controllers\Admin\Users->index()
9 SYSTEMPATH\CodeIgniter.php(497): CodeIgniter\CodeIgniter->runController()
10 SYSTEMPATH\CodeIgniter.php(366): CodeIgniter\CodeIgniter->handleRequest()
11 FCPATH\index.php(67): CodeIgniter\CodeIgniter->run()