Skip to content

PagesVersions: auto-retry-on-schema-mismatch only wraps getPageVersions() — loadPageVersion() and getVersionNumberByName() still throw 42S22 (6da3d390) #2237

@adrianbj

Description

@adrianbj

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions