CodeIgniter icon indicating copy to clipboard operation
CodeIgniter copied to clipboard

Could not find the language line "insert_batch() called with no data"

Open jamieburchell opened this issue 2 years ago • 3 comments

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

jamieburchell avatar May 12 '23 08:05 jamieburchell

Which PHP version are you using?

otengkwame avatar May 18 '23 19:05 otengkwame

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.

jamieburchell avatar May 18 '23 19:05 jamieburchell

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;

daveherman71 avatar May 19 '23 05:05 daveherman71