Skip to content

Fix employee workshop lookups using positional bindings#123

Merged
Kettailor merged 3 commits into
devfrom
codex/fix-and-refactor-warehouse-management-code
Dec 25, 2025
Merged

Fix employee workshop lookups using positional bindings#123
Kettailor merged 3 commits into
devfrom
codex/fix-and-refactor-warehouse-management-code

Conversation

@Kettailor

Copy link
Copy Markdown
Owner

Motivation

  • Fix a PDOException: SQLSTATE[HY093]: Invalid parameter number caused by reusing the same named parameter multiple times in workshop lookup queries.
  • Prevent failures when resolving workshop access that surface in warehouse flows (stack trace referenced Employee::getWorkshopIdsForEmployee).
  • Make employee-to-workshop membership checks more reliable across different PDO drivers.
  • Reduce runtime errors when creating/updating warehouses that validate employee workshop membership.

Description

  • Replaced repeated named placeholders with positional ? placeholders in models/Employee.php for getWorkshopIdsForEmployee.
  • Applied the same positional binding fix to isEmployeeInWorkshop and bound the workshop id as the fourth parameter.
  • Updated parameter binding calls to numeric indexes using bindValue(1, ...), bindValue(2, ...), etc.
  • Change is limited to models/Employee.php to address the invalid-parameter error without altering query semantics.

Testing

  • No automated tests were run on this change.

Codex Task

@Kettailor Kettailor merged commit 4118ba1 into dev Dec 25, 2025
1 check passed
@Kettailor Kettailor deleted the codex/fix-and-refactor-warehouse-management-code branch December 25, 2025 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant