Skip to content

allow custom qbpager page parameter - #227

Merged
flack merged 2 commits into
flack:masterfrom
duakayra:customize-qbpager-page-param
Aug 11, 2026
Merged

allow custom qbpager page parameter#227
flack merged 2 commits into
flack:masterfrom
duakayra:customize-qbpager-page-param

Conversation

@duakayra

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread lib/org/openpsa/qbpager/main.php Outdated

$this->_pager_id = $pager_id;
$this->_prefix = 'org_openpsa_qbpager_' . $pager_id . '_';
$this->_prefix = $prefix ?? 'org_openpsa_qbpager_' . $pager_id . '_page';

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this I find a bit hard to read. Is it ($prefix ?? 'org_openpsa_qbpager_') . $pager_id . '_page' or is it $prefix ?? ('org_openpsa_qbpager_' . $pager_id . '_page')?

Comment thread lib/org/openpsa/qbpager/main.php Outdated
$this->_current_page = max(1, (int) $_REQUEST[$page_var]);
}
$results_var = $this->_prefix . 'results';
$results_var = 'org_openpsa_qbpager_' . $this->_pager_id . '_results';

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems a bit inconsistent to not use the prefix here. Why does this need to change?

Comment thread lib/org/openpsa/qbpager/main.php Outdated
private $total;

public function __construct(string $classname, string $pager_id)
public function __construct(string $classname, string $pager_id, ?string $prefix = null)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe as a more general comment: Is it really necessary to add a new parameter here? Shouldn't pager_id be enough to uniquely identify a pager instance?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i couldn’t merge initialize() into __construct() because the parent constructor can’t be used here. it expects a DBA class and tries to resolve the classname through the MidCOM class loader. based on the tests midgard_style is already a raw MgdSchema class, so the conversion fails before the direct query builder can be created

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah, makes sense. Didn't notice that qbpager extends querybuilder

@flack
flack merged commit 3bc7cbd into flack:master Aug 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants