DAY-3 various code fixes, critical error
DAY 3
thanks @owlbrudder
following explanation:
Multiple source code anomalies pose a critical error on ci4 v4.4.3
see below
2023/10/26
http://ci4_opensourceospos_latest/public/item_kits/save/
CRITICAL - 2023-10-26 13:19:02 --> NumberFormatter::setAttribute(): Argument #2 ($value) must be of type int|float, string given
IN APPPATH/Helpers/locale_helper.php on line 446.
Error: Incorrect contents fetched, please reload.
FIX
if(empty($config['thousands_separator']))
{
$fmt->setAttribute(NumberFormatter::GROUPING_SEPARATOR_SYMBOL, 0);
}
CRITICAL - 2023-10-27 06:34:21 --> NumberFormatter::setAttribute(): Argument #2 ($value) must be of type int|float, string given
IN APPPATH/Controllers/Config.php on line 482.
if($this->request->getPost('thousands_separator') == 'false')
{
$fmt->setAttribute(NumberFormatter::GROUPING_SEPARATOR_SYMBOL, 0);
}
ERROR 500 /root/ci4_opensourceospos_latest/public/messages/send/
IN APPATH/Controllers/Messages.php
line 45 replace send with postSend
public function postSend(): void
{ ...
IN APPATH/Controllers/Home.php
line 29 replace change_password with getChange_password
public function getChange_password(int $employee_id = -1): void //TODO: Replace -1 with a constant
{
...
Update ci4 4.3.1 to ci4 4.4.3
SEE this https://codeigniter.com/user_guide/installation/upgrade_440.html#mandatory-file-changes
AND https://codeigniter.com/user_guide/installation/upgrade_440.html#config-files