CodeIgniter
CodeIgniter copied to clipboard
Could not find the language line "insert_batch() called with no data"
There are a couple of places in the DB_query_builder.php file where a missing language line is referenced:
https://github.com/bcit-ci/CodeIgniter/blob/45576ef6e62b5ff59da67f1697ee8c57809c7719/system/database/DB_query_builder.php#L1499
https://github.com/bcit-ci/CodeIgniter/blob/45576ef6e62b5ff59da67f1697ee8c57809c7719/system/database/DB_query_builder.php#L1916
Which PHP version are you using?
Which PHP version are you using?
PHP 8.1, but it's not relevant because the language keys are just missing in CI's DB lang file. If you look at the other references to lang keys they are all in a lowercase/underscore format rather than a sentence.
I am using the develop branch so the line numbers differ, but here are the required changes to fix this issue:
Add the following line to /system/language/english/db_lang.php
$lang['db_data_required'] = '%s called with no data';
And then change line 1499 in /system/database/DB_query_builder.php:
return ($this->db_debug) ? $this->display_error('db_data_required', 'insert_batch()') : FALSE;
And line 1916:
return ($this->db_debug) ? $this->display_error('db_data_required', 'update_batch()') : FALSE;