Workflow module's conditions don't save if the entry is just a space (or trimmable character): since 7.14.6 #5357

Open
opened 2026-02-20 17:00:06 -05:00 by deekerman · 0 comments
Owner

Originally created by @DJUserkent on GitHub (Jan 5, 2026).

Issue

The bug means that any condition field that contains only a space (or any other character removed by PHP's 'trim') - is not saved to the database on save.

So it is no longer possible to do things like:

  • Condition: there is no space character in a long phone number,
  • Action: add a space in the middle.

Root cause - 7.14.6 added a default 'trim' to every text field in all modules: in the 'cleanBean' function in data/SugarBean.php

Tested on 7.15.0 - also fails

Possible Fix

The proven fix is to remove the lines added in data/SugarBean.php; that was added in Suite 7.14.6:

// Trim name & varchar type values on save when the value is not null if (isset($def['type']) && in_array($def['type'], ['name', 'varchar']) && !is_null($this->$key ?? null)) { $this->$key = trim($this->$key); }

Steps to Reproduce the Issue

1. Create a Workflow in any module:  in the Conditions add any text field and select 'Contains' or 'starts with': and enter a space in the final column.
2. Save the Workflow.
3. Edit the workflow: and see that the space character is no longer there.

Context

No response

Version

7.14.6 and 7.15.0

What browser are you currently using?

Chrome

Browser Version

No response

Environment Information

PHP 8.2 MariaDB

Operating System and Version

Ubuntu 24

Originally created by @DJUserkent on GitHub (Jan 5, 2026). ### Issue The bug means that any condition field that contains only a space (or any other character removed by PHP's 'trim') - is not saved to the database on save. So it is no longer possible to do things like: * Condition: there is no space character in a long phone number, * Action: add a space in the middle. Root cause - 7.14.6 added a default 'trim' to every text field in all modules: in the 'cleanBean' function in data/SugarBean.php Tested on 7.15.0 - also fails ### Possible Fix The proven fix is to remove the lines added in data/SugarBean.php; that was added in Suite 7.14.6: ` // Trim name & varchar type values on save when the value is not null if (isset($def['type']) && in_array($def['type'], ['name', 'varchar']) && !is_null($this->$key ?? null)) { $this->$key = trim($this->$key); } ` ### Steps to Reproduce the Issue ```bash 1. Create a Workflow in any module: in the Conditions add any text field and select 'Contains' or 'starts with': and enter a space in the final column. 2. Save the Workflow. 3. Edit the workflow: and see that the space character is no longer there. ``` ### Context _No response_ ### Version 7.14.6 and 7.15.0 ### What browser are you currently using? Chrome ### Browser Version _No response_ ### Environment Information PHP 8.2 MariaDB ### Operating System and Version Ubuntu 24
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#5357
No description provided.