Blog Sections Open

When the PHx replace Modifier Does Not Work

If <code>replace</code> in PHx does nothing, check the input value and parsing chain before assuming the modifier itself is broken.

The donor issue was simple on the surface: a PHx modifier that should replace part of a placeholder value did nothing at all. In practice, this kind of failure often comes from the value not being present in the form you expect at parse time.

Example

[+image-post:replace=`medium,mini`+]

Debugging Checklist

  • Confirm the placeholder actually contains the expected string before modifiers are applied.
  • Check whether the placeholder is cached or generated by a later snippet call.
  • Verify the PHx version bundled with the project or custom build.
  • Test the same replacement on a literal value to separate parser issues from data issues.

On older custom builds, modifier behavior can differ slightly from what older articles describe. A quick controlled test with a known string is usually faster than patching template code blindly.

Newer post

Diagnosing Slow Manager Loads in MODX Custom 1.0.9

A practical approach to isolating slow backend loading in a custom Evolution CMS build by comparing baseline installs and real projects.

Older post

Fixing eForm Email Encoding Problems on PHP 5.3

How to diagnose garbled Cyrillic email output from eForm and separate encoding issues from transport issues.