We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25357
    • 92 Posts
    Not sure if this is a bug or something due to our environment, but finally have an almost trackable instance I can share.

    modX Revo 2.0.8-pl advanced
    Linux/Apache
    OS CentOS (multiple versions, rendered irrelevant by below)
    mysql 4.1.22
    PHP 5.2.17
    Management: WHM 11.30.4

    Resources in use: There are about 200-300 active resources in this implementation, not all of them are pages, many are children and only "bits" of rendered output.

    Issue: Template variables sporadically lose connection with templates.

    Scenario: Locations "general listing" page and a locations "Details" page. Yesterday (the 27th) it was reported as "fine" (which gets important in a sec) but today (28th) the phone numbers are all missing.

    The two pages use the same TV, but different templates. Sure enough, I went into the "phone" TV and the assignments to the two templates were unchecked.

    I have seen this before on various servers, one install was on a Dreamhost VPS, this one is on a Liquid Web dedi with 20-30 domains. From time to time data goes missing on public pages and when I track it down, it's always the same, the template variables are no longer associated with the templates. Re-check the box, save, phone numbers return.

    Usually when I see this it's just one TV and one template, but what's interesting is that today's instance involves nuking **all** the templates the TV is attached to. If it's of any use, there are many other TV's attached to these templates (address, city, state, long, lat, etc.) and they all remained connected. Also of note, the data is fine, phone numbers all still present - they just lost the connection to the templates.

    Today I have at least a *little* info on events: there is only one user, the Manage Actions shows that user logged in on the 26th and updated an unrelated document (i.e., *not* any of the locations documents.) The next and last entry is me fixing the TV's. I'd copy and paste the entries but that appears to be disabled. The two actions of course were save_resource and tv_update.

    If the TV's **truly** were OK yesterday (just asked her and she claims they were) then I guess the update on the 26th was unrelated and I'm lost as to what the cause could be.

    I have been scrounging around for an hour or so looking for posts and similar documents relating to this and can't locate any.

    Any ideas, or how to insure the TV's stay stuck? smiley
    [ed. note: rocknbil last edited this post 12 years, 6 months ago.]
      • 25357
      • 92 Posts
      No one has seen this issue? I just scoured again and can't find any topics on it. If it's "something I'm doing" (which is extremely likely) I'm all ears -> C C .... but I'd be doing it on several unrelated servers.
        • 3749
        • 24,544 Posts
        I've seen TVs lose their values (due to a bug in the Resource create processor), but I've never seen them spontaneously lose their connection to templates and I don't recall seeing any posts about it here.

        If it happens again, try deleting all the files in the core/cache directory. If the cache is corrupted, lots of odd stuff can happen.

        I'd also suggest updating the site to the current version.

        BTW, here is some code that should check to see if the TV's are really disconnected (and rule out problems with the display in the Manager). Replace '12' with the ID of the template you want to check.

        [[!TVConnectionCheck? &templateId = `12`]]

        <?php
        /* TVConnectionCheck snippet */
        
        $template = $modx->getObject('modTemplate`, $scriptProperties['templateId']);
        $tvs = $template->getMany('TemplateVars');
        
        $output = 'Template variables for resource: ' . $scriptProperties['TemplateId'];
        
        foreach ($tvs as $tv) {
            $output .= $tv->get('name');
        }
        return $output;


        (I put some HTML tags in the code above to format the output, but the forum stripped them out.) [ed. note: BobRay last edited this post 12 years, 6 months ago.]
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 25357
          • 92 Posts
          Thank you, bookmarked and will return and run this test when it does. It's fairly infrequent, but have seen it happen 3 times in a week on one site, then nothing for months and it just crops up on a different site and server.

          I'll also be mindful of versions - it's actually spread across many, the one at hand was 2.0.8, but have many installs and have always installed "the latest" with each new site. Would be glad to update if the client is willing to pay for the time. smiley