Mystery site crash - no content on any page

I installed pdoTools in MODX 2.8.6, without noticing that it needed an update. I tried pdoMenu on one page (didn’t work). Then I found that the content was missing from all resources.

The content tag in all Templates was changed from

[[*content]]

to

[[*#content]]

which MODX failed to parse.

At first I suspected pdoTools, but there’s nothing in its code that would do this. My apologies for at first suggesting that it had caused the problem – I should have checked the code before posting.

Everything is fine since I removed the # tokens.

My next theory was that FastField was the culprit, though I have no memory of ever installing or using it.

FastField does use that # token:

class modResourceFieldTag extends modFieldTag {

    /**
     * Overrides modTag::__construct to set the Field Tag token
     * {@inheritdoc}
     */
    function __construct(modX & $modx) {
        parent :: __construct($modx);
        $this->setToken('#');
    }

But nothing in the code of the current version would cause my problem.

I’m left with a mystery. My only conjecture is that at some point in the dim past, I installed FastField to help someone with a problem here, and put in the # tokens to test it. Then I recently uninstalled it without removing the tokens. Why I would put them on every content tag in about a dozen templates would still be a mystery.

Other theories welcomed.

Are you sure pdoTools did this?
This seems very unlikely. Why would it do that?

1 Like

[quote=“bobray General Motors, post:1, topic:7645, full:true”]
I installed pdoTools in MODX 2.8.6, without noticing that it needed an update. I tried pdoMenu on one page (didn’t work). Then I found that the content was missing from all resources.

The content tag in all Templates was changed from

[[*content]]

to

[[*#content]]

which MODX failed to parse.

At first I suspected pdoTools, but there’s nothing in its code that would do this. My apologies for at first suggesting that it had caused the problem – I should have checked the code before posting.

Everything is fine since I removed the # tokens.

My next theory was that FastField was the culprit, though I have no memory of ever installing or using it.

FastField does use that # token:

class modResourceFieldTag extends modFieldTag {

    /**
     * Overrides modTag::__construct to set the Field Tag token
     * {@inheritdoc}
     */
    function __construct(modX & $modx) {
        parent :: __construct($modx);
        $this->setToken('#');
    }

But nothing in the code of the current version would cause my problem.

I’m left with a mystery. My only conjecture is that at some point in the dim past, I installed FastField to help someone with a problem here, and put in the # tokens to test it. Then I recently uninstalled it without removing the tokens. Why I would put them on every content tag in about a dozen templates would still be a mystery.

Other theories welcomed.
[/quote]

Hello, @bobray

It’s quite a puzzle you’ve encountered with MODX and the unexpected change in your content tags. Your theory about FastField could be a plausible explanation, especially if it was installed at some point and the # tokens were not removed upon uninstallation. It’s also possible that another plugin or a manual error could have introduced the # tokens into your templates.

Here are a few steps you might consider to prevent similar issues in the future:

Version Control: Implement a version control system for your MODX templates if you haven’t already. This way, you can track changes over time and revert to previous versions if necessary.
Regular Audits: Periodically review installed plugins and their updates to ensure compatibility with your MODX version.
Testing Environment: Maintain a separate testing environment where you can safely install and uninstall plugins without affecting your live site.

If you have any other details or if there’s anything specific you’d like to explore, please let me know, and I’ll do my best to assist you!

Best Regard,
ryan1969

Excellent tips. Thanks!