Short description of the issue
Commit 6da3d390 added a 42S22 catch + upgrade() retry around getPageVersions() to handle un-upgraded installs where the name column is missing. Other methods in PagesVersions that also reference the name column do not have the same retry wrapper and still throw an unhandled PDOException on un-upgraded installs.
Expected behavior
Any PagesVersions API call gracefully upgrades the schema (or surfaces a clear WireException) on installs that haven't yet picked up the v3 schema with the name column.
Actual behavior
In wire/modules/PagesVersions/PagesVersions.module.php:
getPageVersions() — wrapped with try/catch + upgrade + retry.
loadPageVersion() line ~138 — SELECT name, description, data, ... from pages_versions, no try/catch. Throws raw SQLSTATE 42S22 if name column is missing.
getVersionNumberByName() line ~1427 — also references name column, no try/catch.
Optional: Suggestion for a possible fix
Either wrap the affected methods in the same try/catch + retry pattern, or run the schema upgrade idempotently from module init() instead of relying on lazy upgrade-on-query.
Setup/Environment
- ProcessWire version:
dev @ 15c749ed
- File:
wire/modules/PagesVersions/PagesVersions.module.php
- Introduced in commit 6da3d390
Short description of the issue
Commit 6da3d390 added a 42S22 catch +
upgrade()retry aroundgetPageVersions()to handle un-upgraded installs where thenamecolumn is missing. Other methods inPagesVersionsthat also reference thenamecolumn do not have the same retry wrapper and still throw an unhandled PDOException on un-upgraded installs.Expected behavior
Any PagesVersions API call gracefully upgrades the schema (or surfaces a clear
WireException) on installs that haven't yet picked up the v3 schema with thenamecolumn.Actual behavior
In
wire/modules/PagesVersions/PagesVersions.module.php:getPageVersions()— wrapped with try/catch + upgrade + retry.loadPageVersion()line ~138 —SELECT name, description, data, ...frompages_versions, no try/catch. Throws raw SQLSTATE 42S22 ifnamecolumn is missing.getVersionNumberByName()line ~1427 — also referencesnamecolumn, no try/catch.Optional: Suggestion for a possible fix
Either wrap the affected methods in the same try/catch + retry pattern, or run the schema upgrade idempotently from module
init()instead of relying on lazy upgrade-on-query.Setup/Environment
dev@15c749edwire/modules/PagesVersions/PagesVersions.module.php