Updating Extras for 3.0
Last updated Sep 28th, 2026 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$204 per month—let's make that $500!
Learn moreSite owners use Upgrading from 2.x to 3.0. This page is for authors who build or maintain transport packages.
Compatible packages: SiteDash extras list. Linked pages below cover each topic in depth. The Collection notes from theboxer (summary on modx.pro) are a worked example of an Extra that extends modResource.
Support scope¶
| Goal | Approach |
|---|---|
| MODX 3 only | Namespaced classes, PSR-4 models, bootstrap.php. Drop require_once of old core paths. |
| One package for 2.x and 3.x | Branch on version ($modx->version['version'] >= 3), class-name prefixes or dynamic parent classes. More work. Overview: Modernizing Extras cheat sheet. |
Global aliases (modResource, modObjectCreateProcessor, and similar) still load by default in 3.0-3.2 through load_deprecated_global_class_aliases. Automatic loading is scheduled to stop in 3.3, so move to namespaced code before then. See Changed class names.
Checklist¶
- PHP: match the floor for the MODX line you support (requirements).
- Class names: in
extends, type hints, andinstanceof, replace short core names withMODX\Revolution\…/xPDO\…. Tables: Changed class names. - Processors: extend the new processor namespaces. Remove flat-file processors. Drop
require_onceofcore/model/modx/modprocessor.class.phpand…/processors/resource/*.class.php(those paths are gone). Details: Processors. - xPDO models: set schema
packageto a PHP namespace,version="3.0", regeneratemetadata.mysql.php, calladdPackagewith a namespace prefix, register PSR-4. Guide: xPDO 3. -
bootstrap.php: optional file at the Extra core root (namespace path). Register autoload,addPackage, and DI services. See Namespaces and DI container. - Menus / CMP: no
modAction. Menuactionis a controller name in the namespace (/manager/?namespace=myextra&a=home). See modAction and related. - Manager JS:
MODx.config.manager_language→MODx.config.cultureKey(Manager language). - HTTP client:
modRestClientis gone. Use the HTTP service. - Build / install: test install and upgrade on MODX 3. Prefer current scaffolds (ModExtra3 for 3.x). Package markdown attributes are parsed in 3.0 (build script).
Example: Extra that extends modResource (Collections)¶
If a custom resource must show up in $modx->getDescendants(\MODX\Revolution\modResource::class), the schema extends value must be the namespaced core class.
Schema¶
Before:
<object class="CollectionContainer" extends="modResource">
<!-- columns unchanged -->
</object>
After:
<object class="CollectionContainer" extends="MODX\Revolution\modResource">
<!-- columns unchanged -->
</object>
Rebuild the model so metadata.mysql.php picks up the change.
PHP class and processors¶
Delete obsolete includes such as:
require_once MODX_CORE_PATH . 'model/modx/modprocessor.class.php';
require_once MODX_CORE_PATH . 'model/modx/processors/resource/create.class.php';
require_once MODX_CORE_PATH . 'model/modx/processors/resource/update.class.php';
Extend the namespaced types instead:
| 2.x | 3.x |
|---|---|
modResource |
MODX\Revolution\modResource |
modResourceCreateProcessor |
MODX\Revolution\Processors\Resource\Create |
modResourceUpdateProcessor |
MODX\Revolution\Processors\Resource\Update |
Apply the same mapping to any custom {ClassKey}CreateProcessor / {ClassKey}UpdateProcessor. See Processors and Custom resource classes.
Related pages¶
- Breaking changes
- Changed class names
- Processors
- xPDO 3
- modAction and related
- Namespaces
- Modernizing Extras (MODX blog series)
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$204 per month—let's make that $500!
Learn more










