Repository navigation
FOUR-34642 PMQL Is Invalid when loading Tasks page with Process column enabled - #9208
devmiguelangel wants to merge 6 commits into
Conversation
…blic in ProcessMakerModel
…index fields and relation handling
…ControllerIndexMethods
PR SummaryMedium Risk Overview Task index The legacy Reviewed by Cursor Bugbot for commit a97f110. Bugbot is set up for automated code reviews on this repo. Configure here. |
…ve process request handling
1cef8bc to
a97f110
Compare
|
QA server K8S was successfully deployed https://tenant-1.ci-f02a3f5349.engk8s.processmaker.net |
|




Issue & Reproduction Steps
/tasksshows "PMQL Is Invalid." and the Inbox never loads when the task columns include the default Process column (process_request.name).OPTIMIZED_TASKS_ENABLEDon (default).process_request.name)./tasks.GET /api/1.0/tasks?...&columns=case_number,...,process_request.namereturns 422.Cause:
mapColumnsToFields()inTaskControllerIndexMethodspassed any unrecognised column straight into theSELECTonprocess_request_tokens. The query failed withUnknown column 'process_request.name' in 'field list'.handleQueryException()reports everyQueryExceptionas a PMQL error. The same failure hitprocess_request.id,process.*,user.*and unknown columns. It is a regression from the optimized task index, first shipped in v2026.17.1.Solution
TaskControllerIndexMethods: addsanitizeIndexFields(). Relation columns (process_request.*,processRequest.*,process.*,user.*) map to their foreign key (process_request_id,process_id,user_id), so the eager-loaded relations still render. Any other column that is not a realprocess_request_tokenscolumn is dropped.fieldsparam, on both the optimized and the legacyApi\TaskController::index().ProcessMakerModel::getTableColumns()is now public so the cached schema column list can be used as the whitelist.handleQueryException()copies now also match'field list'and'order clause'errors, so the message names the offending column. The "PMQL Is Invalid." prefix is unchanged.tests/Feature/Api/TasksTest.php.CleanShot.2026-11-30.at.10.46.10.AM.mp4
How to Test
./vendor/bin/phpunit tests/Feature/Api/TasksTest.php(73 tests pass).TaskControllerTestandTaskListNonAdminCaseTitleOrderTestalso pass./tasksas an Admin and an Operator. The Inbox loads with the Process column filled in and no toast.columns=...,process_request.name) now returns 200.Related Tickets & Packages
FOUR-34642
Code Review Checklist
ci:deploy