Api request does not take deleted parameter properly #5325

Open
opened 2026-02-20 16:59:38 -05:00 by deekerman · 0 comments
Owner

Originally created by @AlexMyddleware on GitHub (May 22, 2025).

Issue

An api request to get records will not work with the deleted filter

Possible Fix

change the following in public/legacy/Api/V8/Service/ModuleService.php (line 202)

        foreach ($beanListResponse->getBeans() as $bean) {
            $bean = $this->beanManager->getBeanSafe(
                $params->getModuleName(),
                $bean->id
            );

to

        foreach ($beanListResponse->getBeans() as $bean) {
            $bean = $this->beanManager->getBeanSafe(
                $params->getModuleName(),
                $bean->id
                $bean->id,
				[],
				!$deleted
            );

Steps to Reproduce the Issue

send an api request using the filter

filter[deleted][eq]=1

and you will not get the deleted records even if you should.

Context

if you launch an api to get some records, and for some reason you want to include deleted records (marked with deleted to 1 in the database) then the filter does not work. The proposed fix makes it work.

Version

8.6.0

What browser are you currently using?

Chrome

Browser Version

No response

Environment Information

Version 136.0.7103.114 (Official Build) (64-bit)

Operating System and Version

Windows 11

Originally created by @AlexMyddleware on GitHub (May 22, 2025). ### Issue An api request to get records will not work with the deleted filter ### Possible Fix change the following in public/legacy/Api/V8/Service/ModuleService.php (line 202) ``` foreach ($beanListResponse->getBeans() as $bean) { $bean = $this->beanManager->getBeanSafe( $params->getModuleName(), $bean->id ); ``` to ``` foreach ($beanListResponse->getBeans() as $bean) { $bean = $this->beanManager->getBeanSafe( $params->getModuleName(), $bean->id $bean->id, [], !$deleted ); ``` ### Steps to Reproduce the Issue ```bash send an api request using the filter filter[deleted][eq]=1 and you will not get the deleted records even if you should. ``` ### Context if you launch an api to get some records, and for some reason you want to include deleted records (marked with deleted to 1 in the database) then the filter does not work. The proposed fix makes it work. ### Version 8.6.0 ### What browser are you currently using? Chrome ### Browser Version _No response_ ### Environment Information Version 136.0.7103.114 (Official Build) (64-bit) ### Operating System and Version Windows 11
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#5325
No description provided.