Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LEAF-4581 - extended character sets #2612

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LEAF-Automated-Tests
1 change: 1 addition & 0 deletions LEAF_Request_Portal/sources/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@ public function isCategory($categoryID)
*/
private function writeDataField($recordID, $key, $series)
{

if (is_array($_POST[$key])) //multiselect, checkbox, grid items
{
$_POST[$key] = XSSHelpers::scrubObjectOrArray($_POST[$key]);
Expand Down
2 changes: 1 addition & 1 deletion LEAF_Request_Portal/sources/FormWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ private function getFields(): array
default:
break;
}
$data = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $data);
//$data = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $data);
$formattedFields["content"][$field['indicatorID']] = $data !== "" ? $data : $field["default"];
$formattedFields["to_cc_content"][$field['indicatorID']] = $emailValue;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Leaf/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __construct($host, $user, $pass, $database, $abortOnError = fals

$this->isConnected = false;
}

$this->db->exec("SET NAMES 'utf8mb4'");
unset($pass);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
START TRANSACTION;

ALTER TABLE `data`
CHANGE `data` `data` text COLLATE 'utf8mb4_general_ci' NOT NULL AFTER `series`,
CHANGE `userID` `userID` varchar(50) COLLATE 'utf8mb4_general_ci' NOT NULL AFTER `timestamp`,
COLLATE 'utf8mb4_general_ci';

ALTER TABLE `data_history`
CHANGE `data` `data` text COLLATE 'utf8mb4_general_ci' NOT NULL AFTER `series`,
CHANGE `userID` `userID` varchar(50) COLLATE 'utf8mb4_general_ci' NOT NULL AFTER `timestamp`,
CHANGE `userDisplay` `userDisplay` varchar(90) COLLATE 'utf8mb4_general_ci' NULL AFTER `userID`,
COLLATE 'utf8mb4_general_ci';

ALTER TABLE `records`
CHANGE `userID` `userID` varchar(50) COLLATE 'utf8mb4_general_ci' NOT NULL AFTER `serviceID`,
CHANGE `title` `title` text COLLATE 'utf8mb4_general_ci' NULL AFTER `userID`,
CHANGE `lastStatus` `lastStatus` text COLLATE 'utf8mb4_general_ci' NULL AFTER `priority`,
COLLATE 'utf8mb4_general_ci';


UPDATE `settings` SET `data` = '2024112500' WHERE `settings`.`setting` = 'dbversion';

COMMIT;

/**** Revert DB ***** NOTE: Data could have issues going back if it contains data that is in the mb4 set
START TRANSACTION;

ALTER TABLE `data`
CHANGE `data` `data` text COLLATE 'utf8mb3_general_ci' NOT NULL AFTER `series`,
CHANGE `userID` `userID` varchar(50) COLLATE 'utf8mb3_general_ci' NOT NULL AFTER `timestamp`,
COLLATE 'utf8mb3_general_ci';

ALTER TABLE `data_history`
CHANGE `data` `data` text COLLATE 'utf8mb3_general_ci' NOT NULL AFTER `series`,
CHANGE `userID` `userID` varchar(50) COLLATE 'utf8mb3_general_ci' NOT NULL AFTER `timestamp`,
CHANGE `userDisplay` `userDisplay` varchar(90) COLLATE 'utf8mb3_general_ci' NULL AFTER `userID`,
COLLATE 'utf8mb3_general_ci';

ALTER TABLE `records`
CHANGE `userID` `userID` varchar(50) COLLATE 'utf8mb3_general_ci' NOT NULL AFTER `serviceID`,
CHANGE `title` `title` text COLLATE 'utf8mb3_general_ci' NULL AFTER `userID`,
COLLATE 'utf8mb3_general_ci';

UPDATE `settings` SET `data` = '2024101500' WHERE `settings`.`setting` = 'dbversion';

COMMIT;
*/
Loading