key 'next_offset' of returned value from $bean->get_list() is incorrect #5345

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

Originally created by @kale1d0code on GitHub (Oct 20, 2025).

Issue

I've created a contact record,
and executed $records = $bean->get_list('name', $whereClause, 0, $batchSize);

$records['next_offset'] is 20 when it should be -1

Possible Fix

I don't know where in the code the mistake is

Steps to Reproduce the Issue

  1. Setup SuiteCRM
  2. create a contact record
  3. execute
 $records = $bean->get_list('name', $whereClause, 0, $batchSize);

in code somehow and check out the ['next_offset'] value from what is returned it should be -1 as there would be no other pages.

$whereClause for me is "contacts.$checkField = 0" where $checkField is the name of a checkbox field.
and BatchSize is set to 50 (I would have expected next_offset to be 50 which leads me to think next_offset definitely has a problem)

Context

unable to build a synconisation task for an external service due to the inability to determine if there are any more records to send.

Version

7.14.6

What browser are you currently using?

Chrome

Browser Version

Version 136.0.7103.92 (Official Build) (64-bit)

Environment Information

PHP 8.1.30

Operating System and Version

Debian GNU/Linux 12 (bookworm)

Originally created by @kale1d0code on GitHub (Oct 20, 2025). ### Issue I've created a contact record, and executed ```$records = $bean->get_list('name', $whereClause, 0, $batchSize);``` $records['next_offset'] is 20 when it should be -1 ### Possible Fix I don't know where in the code the mistake is ### Steps to Reproduce the Issue 1. Setup SuiteCRM 2. create a contact record 3. execute ```php $records = $bean->get_list('name', $whereClause, 0, $batchSize); ``` in code somehow and check out the ['next_offset'] value from what is returned it should be -1 as there would be no other pages. $whereClause for me is "contacts.$checkField = 0" where $checkField is the name of a checkbox field. and BatchSize is set to 50 (I would have expected next_offset to be 50 which leads me to think next_offset definitely has a problem) ### Context unable to build a synconisation task for an external service due to the inability to determine if there are any more records to send. ### Version 7.14.6 ### What browser are you currently using? Chrome ### Browser Version Version 136.0.7103.92 (Official Build) (64-bit) ### Environment Information PHP 8.1.30 ### Operating System and Version Debian GNU/Linux 12 (bookworm)
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#5345
No description provided.