Skip to content

ProcessPagesExportImport relies on $pages->porter() having been called before direct 'new PagesExportImport()' (650473fa + 2c064268) #2242

@adrianbj

Description

@adrianbj

Short description of the issue

Commit 650473fa updated most usages to access PagesExportImport via $pages->porter(), but two direct new PagesExportImport() instantiations remain at lines ~1090 and ~1139 of ProcessPagesExportImport.module. With PagesExportImport moved to wire/core/Pages/ (commit 2c064268) and the Pages class-loader prefix commented out (commit fcce89d5), those new calls only succeed if a prior code path called $pages->porter() (which calls require_once).

Expected behavior

new PagesExportImport() succeeds without prerequisites — the class is autoloaded normally.

Actual behavior

In wire/modules/Process/ProcessPagesExportImport/ProcessPagesExportImport.module:

  • Lines ~1090 and ~1139 still do new PagesExportImport(...) directly.
  • The class file is at wire/core/Pages/PagesExportImport.php but is not registered in WireClassLoader/classes.php.
  • Normal request flow hits ___execute() at line 58, which calls $pages->porter() first and requires the file — so the regular flow works. Any code path that hits the affected methods without going through ___execute() fails to autoload.

See related: issue #2214.

Optional: Suggestion for a possible fix

Add the entry to the class loader:

// wire/core/WireClassLoader/classes.php
'PagesExportImport' => 'Pages/',

Or replace the two direct new calls with $this->wire()->pages->porter().

Setup/Environment

  • ProcessWire version: dev @ 15c749ed
  • File: wire/modules/Process/ProcessPagesExportImport/ProcessPagesExportImport.module lines ~1090, ~1139
  • Related commits: 650473fa, 2c064268, fcce89d5

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