We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10525
    • 247 Posts
    Hi,

    my site has run relatively well in 1.0.8, and older versions before that.

    I recently did two things:

    1. I copied the 1.0.8 site to a sandbox so I could do some dev on it offline. All config issues sorted ok and it works fine.

    2. I then upgraded the site to 1.0.12. Again, all config issues sorted ok and it works fine (apart from twitter, but I see the other post on that).

    Until, that is, I tried to create a new resource. I did this by clicking the New Resource button above the tree. The results were as follows:

    i. a new empty resource form opened up, as expected.
    ii. immediately after that, an alert appeared over the resource form, as follows:

    System Alert

    An error occurred while loading. Please see the event log for more information

    Office==122||Broadband Jargon==117||Special Offer==114||Mobile Broadband ==109||BIG Giveaway==106||Solo PDF's==105||Sharer PDF's==104||Broadband PDF's==103||Maintenance Docs==102||VPN FAQ's ==93||SHDS Docs==90||Flow Docs==89||Install==66||Versatility Docs==65||Mobile- Ts & Cs==64||Recruitment==63||Guide==62||nclusive PDF's==61|Plus PDF's==60||Reseller==59||Business==58||Brochure==57||Infinity Docs==56||Clear Documents==55||Inclusive PDFs==54||

    (these pages all exist, are all hidden from the menu and all under the same container.)

    I clicked OK to close and went to have a look at Reports > System Events.

    There was an entry there, "Parser - Snippet - Creating a resource" (Event Id = 0, User = 'admin').
    Opening this gave the following error report:

    Warning!

    Event Id: 0 Source: Parser - Snippet - Creating a resource Date: 27-10-2013 10:39:43 User: admin

    « MODX Parse Error »
    MODX encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »
    PHP error debug
    ErrorType[num] : NOTICE[8]
    File : /var/www/vhosts/[mydomain.com]/httpdocs/dev2/assets/snippets/ditto/snippet.ditto.php
    Line : 1084
    Source : Snippet

    Basic info
    REQUEST_URI : /dev2/manager/index.php?a=4
    Manager action :4 - Creating a resource
    Referer : http://www.[mydomain.com]/dev2/manager/index.php?a=1&f=tree
    User Agent : Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0
    IP : [my.ip.address]

    Benchmarks
    MySQL : 0.0044 s (11 Requests)
    PHP : 0.0465 s
    Total : 0.0509 s
    Memory : 3.4312744140625 mb

    Backtrace
    1 include_once()
    manager/index.php on line 307
    2 renderFormElement()
    manager/actions/mutate_content.dynamic.php on line 814
    3 ProcessTVCommand()
    manager/includes/tmplvars.inc.php on line 47
    4 eval()
    manager/includes/tmplvars.commands.inc.php on line 64
    5 DocumentParser->runSnippet()
    manager/includes/tmplvars.commands.inc.php(64) : eval()'d code on line 1
    6 DocumentParser->evalSnippet()
    manager/includes/document.parser.class.inc.php on line 2400

    Can anyone suggest what might be wrong and how I should proceed to remedy this error?

    Addendum: just found I get a similar error when simply trying to open an existing resource for editing.

    PHP Version 5.4.19 [ed. note: Gav last edited this post 10 years, 6 months ago.]
      • 10525
      • 247 Posts
      I just recreated a copy of the same 1.0.8 site and then upgraded to 1.0.12 again. Tested for this as soon as the upgrade was complete and it is failing as described above.

      As well as occurring when I try to create a resource, it occurs when I simply try to edit a resource:
      PHP error debug
      ErrorType[num] : NOTICE[8]
      File : /var/www/vhosts/[mydomain.com]/httpdocs/dev1/assets/snippets/ditto/snippet.ditto.php
      Line : 1084
      Source : Snippet

      I also upgraded another site from 0.9.6 to 1.0 12 and it seems to work ok. I noticed that site is set to only 'View Resource data' when clicking the resource name. As a test, I went to System configuration > Interface & Features > Page Click Behavior and selected 'View Resource data'.

      Clear cache.

      Now when I click on a resource name it opens the View Resource data page, with 3 tabs, opened at the middle one, 'View children' (even if the resource is not a container). No problem.

      If I then right-click on the resource name in the tree and select 'Create Resource here' or 'Edit resource', I get the error popping up. I can duplicate a resource, but I cannot then edit it.

      Anyone recognise what's going on here? Is it a bug in Ditto?
        • 20413
        • 2,877 Posts
        1) Are you using the newest Ditto? The old ones doesn't work in PHP5+
        2) Is this a problem on resources that are free from template variables, snippets and plugins?
          @hawproductions | http://mrhaw.com/

          Infograph: MODX Advanced Install in 7 steps:
          http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

          Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
          http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
          • 10525
          • 247 Posts
          I'm using Ditto version 2.1.1.

          I was using 2.1.0 in Evo 1.0.8, and allowed the upgrade to 1.0.12 to add all of the included snippets.

          I tried to find newer versions, but it doesn't appear to be available now from the MODx site.

          The problem occurs for all resources except for the home page (id=1). They all use wayfinder for menus. I wonder if that uses Ditto?..

          I can't create a test resource free of template variables, snippets and plugins.

            • 20413
            • 2,877 Posts
            Quote from: Gav at Oct 27, 2013, 09:29 PM

            I can't create a test resource free of template variables, snippets and plugins.

            You can go to elements and re-name Ditto to DittoOFF, go to TV's and disconnect them from the template. You can disable plugins! No???

            My thoughts go like this:

            1. Can you run a clean evo1012 on that server with PHP Version 5.4.19
            2. When that works try reimplemnt the code step-by-step (snippets, tv's, chunks and plugins)
            3. This to reproduce what code breaks your site and see what doesn't

            Maybe corrupt files, corrupt cache, conflicting charset and whitespace issues.
            » http://bit.ly/1cblT47
            [ed. note: mrhaw last edited this post 10 years, 6 months ago.]
              @hawproductions | http://mrhaw.com/

              Infograph: MODX Advanced Install in 7 steps:
              http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

              Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
              http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
              • 10525
              • 247 Posts
              MrHaw, you're absolutely right! I was just sitting there trying to create a template-free resource :-/

              Good suggestions, I'll try the clean resource first and then the clean install.

              I hit a couple more issues last night too with both 1.0.8 and 1.0.12 sites in php5.4, notable the inability to save snippets, even if the content is cut and pasted from an existing, working, snippet. I get, "Forbidden, You do not have permission to access this document", even though the snippet is just being stored in the db. Reading around a bit more, I see all sorts of compatability issues between Evo and php 5.3+, so it may be that I have to port everything over to Revo. That will be a huge task though..

              OK here goes..
                • 20413
                • 2,877 Posts
                I have only run EVO1012 on php 5.3+ but EVO should run in 5.4


                * [#10097] htmlspecialchars in >PHP 5.4 no longer defaults to ISO-8859-1
                * [#10100] Add PHP compatible functions
                * [#9696] ImageEditor fix for php5.4
                https://raw.github.com/modxcms/evolution/v1.0.12/install/changelog.txt

                I believe you have charset issues

                Changes that affect compatibility:

                Register globals, magic quotes and safe mode were removed
                The break/continue $var syntax was removed
                The ini option allow_call_time_pass_reference was removed
                The PHP default_charset is now "UTF-8" within the distributed php.ini files, but still defaults to ""
                http://php.net/releases/5_4_0.php

                In Config file AND modx config page you can set "Detection level of the PHP error"
                Choose: Ignore the warning of a slight notice level(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT)
                  @hawproductions | http://mrhaw.com/

                  Infograph: MODX Advanced Install in 7 steps:
                  http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                  Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                  http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                  • 10525
                  • 247 Posts
                  OK I've only managed to get back to this after 5 days.

                  I installed a clean 1.0.12 and it ran fine, so that cleared any compatability issue between 1.0.12 and php 5.4.

                  I then spend some time disengaging resources, templates, chunks and TVs from each other. I pinpointed a single TV which, if accessible to a template, causes the error. (Simply selecting one of these templates from the dropdown in the edit resource window would cause the error box to pop up. Opening the editor window for a resource using this template would cause the error. Select a different template which didn't use this TV and the error disappears).

                  The TV features are:
                  Input Type: DropDown List Menu

                  Input Option Values:
                  @EVAL $params=array('startID'=>32,'tpl'=>'box-testimonial-Tpl','&orderBy'=>'pagetitle DESC'); return $modx->runSnippet('Ditto',$params);

                  The purpose of this TV is to allow the website editor to select a resource which will then be displayed in a sidebox on the page. The resources are contained within a parent resource which is unpublished. This simply acts as a list of sub-content items. The values in the TV are correct (startId, tpl etc).

                  So, what is wrong with my TV input option value? (This is the only time I have ever use @binding). Do I need to alter this to comply with 1.0.12 and/or php 5.4?

                  - note: the original version of this site, still in version 1.0.8, does not exhibit this error. The copies of the site, in both 1.0.8 and upgraded to 1.0.12, do. All sit on the same server.

                  - also, the TV does actually seem to function. But why the popup error? [ed. note: Gav last edited this post 10 years, 6 months ago.]
                    • 16278
                    • 928 Posts
                    Quote from: Gav at Nov 02, 2013, 04:06 PM

                    Input Option Values:
                    @EVAL $params=array('startID'=>32,'tpl'=>'box-testimonial-Tpl','&orderBy'=>'pagetitle DESC'); return $modx->runSnippet('Ditto',$params);

                    Having the ampersand in the orderBy parameter probably isn't helping, even if it's not causing the error.
                    ;) KP
                      • 10525
                      • 247 Posts
                      Yes I saw that and removed it kp52, but unfortunately (and surprisingly) it doesn't make any difference to the error behaviour sad

                      Gav