Skip to content

Class "ProcessWire\PagesExportImport" not found #2214

@dlzi

Description

@dlzi

Short description of the issue

ProcessPagesExportImport.module fails with Class "ProcessWire\PagesExportImport" not found when opening Pages → Export/Import in the admin. The PagesExportImport.php file is present in /wire/core/Pages/ but the class autoloader does not appear to look inside that subdirectory.

Steps to reproduce

  1. Fresh install of ProcessWire
  2. Log in as superuser
  3. Open Pages → Export/Import in the admin

Expected behavior

The Export/Import page loads.

Actual behavior

A fatal error is thrown:

Class "ProcessWire\PagesExportImport" not found
File: wire/modules/Process/ProcessPagesExportImport/ProcessPagesExportImport.module:58

The offending line is:

$this->exportImport = new PagesExportImport();

Diagnosis

PagesExportImport.php exists in my install at:

wire/core/Pages/PagesExportImport.php

…not at wire/core/PagesExportImport.php. find . -iname 'PagesExportImport.php' confirms it's only in the Pages/ subdirectory.

WireClassLoader resolves other reorganized core classes correctly (the trace shows wire/core/Page/Page.php, wire/core/Template/TemplateFile.php, wire/core/WireHooks/WireHooks.php, wire/core/ProcessController/ProcessController.php all loading fine), so it looks like the Pages/ subdirectory is the one that hasn't been registered with the autoloader yet — or this file shouldn't be in a subfolder at all.

Workaround: moving the file to wire/core/PagesExportImport.php resolves the error.

Environment

  • ProcessWire version: 3.0.261
  • Branch / commit: dev
  • PHP version: 8.5.6
  • MySQL / MariaDB version: 11.8.2
  • OS: Arch Linux
  • Web server: PHP built-in server (php -S) with custom router.php
  • 3rd-party modules potentially related: Tracy Debugger 2.11.2

Stack trace (excerpt)

ProcessPagesExportImport.module:58
  → wire/core/Wire.php:405
  → wire/core/WireHooks/WireHooks.php:1077
  → wire/core/Wire.php:476
  → wire/core/ProcessController/ProcessController.php:364
  → wire/core/admin.php:174
  → site/templates/admin.php:19
  → wire/core/Template/TemplateFile.php:328
  → wire/core/Page/Page.php:3106
  → wire/modules/Process/ProcessPageView.module:195
  → index.php:62

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