Go index.php?option=com_workflow&view=workflows&extension=com_contact
Create and save new Workflow
Click Transitions and create new transitions
Type name of transition and try click Save or Save & Close
Saved transition
Save failed with the following error ... "options" .. "cms_workflow_transitions" .. NOT NULL DETAIL
Joomla 5.2.1
PHP 8.1
Postgresql
I fixed it just
ALTER TABLE #__workflow_transitions
ALTER COLUMN options SET DEFAULT '{}';
Labels |
Added:
No Code Attached Yet
|
Well, whath about this patch?
diff --git "a/www/administrator/components/com_workflow/src/Model/TransitionModel.php" "b/www/administrator/components/com_workflow/src/Model/TransitionModel.php"
index a1db4c04..d3ce79ef 100644
--- "a/www/administrator/components/com_workflow/src/Model/TransitionModel.php"
+++ "b/www/administrator/components/com_workflow/src/Model/TransitionModel.php"
@@ -177,7 +177,9 @@ class TransitionModel extends AdminModel
$data['published'] = 0;
}
-
+ if (!key_exists('options', $data) || !$data['options']) {
+ $data['options'] = '{}';
+ }
return parent::save($data);
}
@bembelimen Could you have a look on this issue and check the fix proposed in the previous comment?
@softarius This will casue an SQL error on MySQL 8 as on MySQL 8, columns with TEXT data types (TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT) are not allowed to have a default value. See https://dev.mysql.com/doc/refman/8.0/en/blob.html :
See also PR #27937 .
P.S.: I know, your issue and your fix are for PostgreSQL. But we want to have consistent data structures on all kinds of databases so data can be ported, that's why we also don't use default values on TEXT columns in PostgreSQL anymore.