New slug cannot be stored
In sg_routes 6.3.7 in TYPO3 11.5.28 with PHP 8.1.x and MySQL 10.3.x:
After a slug of a page record is updated and the user clicks on the save button an error message occurs:
An exception occurred while executing 'INSERT INTO sys_redirect (pid, updatedon, createdon, createdby, deleted, disabled, starttime, endtime, source_host, source_path, is_regexp, force_https, respect_query_parameters, keep_query_parameters, target, target_statuscode, hitcount, lasthiton, disable_hitcount) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [153, 1687352855, 1687352855, 2, 0, 0, 0, 0, "<domain>", "\/<slug>", 0, 0, "0", "0", "t3:\/\/page?uid=156&_language=0", 307, 0, 0, 0]: Field 'description' doesn't have a default value
This is due to the sql_mode setting to 'strict' but if one cannot access the DB config it cannot change the slug of the page.
An easy fix would be the following:
In EXT:sg_routes/Classes/Service/CustomSlugServiceV11.php
one could add to the $record
array used in call
$connection->insert('sys_redirect', $record);
the key 'description'
with value ''
.
In the meantime I will put that fix into my custom extension in my installation (having sql_mode set to 'strict') and am happy about an update to be consistent with the official releases of sg_routes.