Hey guys, just here to confirm that this issue is fixed on the github and tested for myself.
If Maintainer could check it out and approve/deny(if not viable) that would really help.
opened 01:28AM - 10 Feb 25 UTC
Type: Bug
Priority:Important
Severity: Moderate
### Issue
When I clear a custom relate field and save the form, the field still… has the original value.
### Possible Fix
At `ApiBeanMapper.php` line 589 update:
```php
if (empty($values[$idName]) && !empty($idValue)) {
$values[$idName] = $idValue;
}
```
to:
```php
if (empty($values[$idName])) {
$values[$idName] = $idValue;
}
```
The update is shown [here](https://github.com/DavidGalicia/SuiteCRM-Core) in commit 277b9b4.
### Steps to Reproduce the Issue
```bash
1. Create a custom relate field called Lead Name in Studio for the Opportunities module and set the related `module` option to Leads
2. Add the custom relate field to the Opportunities Edit and Detail view layouts
3. Create an opportunity record
4. Edit the new record, set the custom relate field to a value and save changes
5. Edit the record again, clear the custom relate field value and save changes
6. Check if the field has the original value
```
Custom relate field:

### Context
_No response_
### Version
8.8.0
### What browser are you currently using?
Chrome
### Browser Version
129.0.6668.89 (Official Build) (64-bit)
### Environment Information
PHP 8.2.26
### Operating System and Version
Debian 12.8.0
Wish you all a great day
rsp
27 March 2025 18:59
2
What do you mean that you cleared the field? When you type in the relate fields, it displays all the records that starts with same alphabets.
The issue is lets say you have a relate field for Opportunity in Leads, if i relate with an Opp and then i want a clear field instead, every time i clear and save it will remais the same Opp. Due to that code it will never clear.
rsp
27 March 2025 19:37
4
Oh now I understood. Thank you for your solution.
Hope, @suitecrm_team team will check it out and merge your changes soon.
Thanks but its was not my solution, i just came across it when fixing a bug myself xD. Just created this post to give enough atention to this fix
1 Like