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

    Due to a PHP upgrade (5.3 to 5.4) , the following error has occured:
    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: Non-static method ditto::buildURL() should not be called statically, assuming $this from incompatible context
    Error type/ Nr.: - 2048
    File: /srv/data/web/vhosts/www.soluprest.com/htdocs/assets/snippets/ditto/extenders/tagging.extender.inc.php
    Line: 319
    Line 319 source: $url = ditto::buildURL("tags=$tag&start=0",$tagDocID);

    PHP Version 5.4.4-2
    MODx Evolution 1.0.6

    Thanks a lot for help.
    Loic

    This question has been answered by Ysanmiguel. See the first response.

      • 16278
      • 928 Posts
      I haven't tried PHP 5.4 yet, but it looks as if this problem can be avoided by declaring the relevant function as static in .../ditto/classes/ditto.class.inc.php (line 1038 )

      	public static function buildURL($args,$id=false,$dittoIdentifier=false) {


      The same goes for two other functions in .../ditto/classes/template.class.inc.php, replace() (line 156) and fetch() (line 197), which are also used by tagging.extender.inc.php

      :) KP
        • 28136
        • 10 Posts
        Thank you KP,
        It's works but now a new problem occurs when some pages are displayed:
        Error HTTP 500 (Internal Server Error) For example: http://www.soluprest.com/administration.htm

        Due to the modified template.class.inc.php. Without "public static function", it works fine.

        Loic
          • 28136
          • 10 Posts
          Solved.
          .../ditto/classes/template.class.inc.php, line 197: static function not required.

          Loic
            • 33238
            • 388 Posts
            Hello, i.m having the same problem.

            what did you do exactly in the: /ditto/classes/template.class.inc.php, line 197?

            and id you change the: .../ditto/classes/ditto.class.inc.php (line 1038 ) too?

            Thank you!
              --
              ysanmiguel.com
            • discuss.answer
              • 33238
              • 388 Posts
              OK SOLVED!

              i didn't understand very well but thanks to you guys that was perfect, just to explain a little bit better, here is:

              what to change?:

              assets/snippets/ditto/classes/ditto.class.inc.php (line 1038 )
              This:
              function buildURL($args,$id=false,$dittoIdentifier=false) {
              
              replace:
              public static function buildURL($args,$id=false,$dittoIdentifier=false) {
              


              assets/snippets/ditto/classes/template.class.inc.php, replace() (line 156)
              This:
              function replace( $placeholders, $tpl ) {
              
              replace:
              public static function replace( $placeholders, $tpl ) {
              


              assets/snippets/ditto/classes/template.class.inc.php, replace() (line 197)
              If you have problems in some pages, don't replace this one!
              This:
              function fetch($tpl){
              
              replace:
              public static function fetch($tpl){
              


              That is all... Thanks to kp52! [ed. note: Ysanmiguel last edited this post 10 years, 8 months ago.]
                --
                ysanmiguel.com
                • 26027
                • 145 Posts
                Quote from: Ysanmiguel at Jul 18, 2013, 04:46 PM
                OK SOLVED!

                i didn't understand very well but thanks to you guys that was perfect, just to explain a little bit better, here is:

                what to change?:

                assets/snippets/ditto/classesditto.class.inc.php (line 1038 )
                This:
                function buildURL($args,$id=false,$dittoIdentifier=false) {
                
                replace:
                public static function buildURL($args,$id=false,$dittoIdentifier=false) {
                


                assets/snippets/ditto/classes/template.class.inc.php, replace() (line 156)
                This:
                function replace( $placeholders, $tpl ) {
                
                replace:
                public static function replace( $placeholders, $tpl ) {
                


                assets/snippets/ditto/classes/template.class.inc.php, replace() (line 197)
                If you have problems in some pages, don't replace this one!
                This:
                function fetch($tpl){
                
                replace:
                public static function fetch($tpl){
                


                That is all... Thanks to kp52!
                Thanks to everyone for solving this problem. You really saved my bacon on this one!!

                Special thanks to Ysanmiguel for summarizing the solution. That helped a lot. BTW, I made only the first two changes, not the "function fetch($tpl)".

                Best ... Sam Gerber
                  • 33238
                  • 388 Posts
                  Nice!!! Your Welcome!
                    --
                    ysanmiguel.com
                    • 45783
                    • 1 Posts
                    I have a very old ModX site. The people who built it for me are long gone and I don't have the $$ to upgrade (aka have a new site built!). I also have never learned to actually code anything and don't have a computer background. That being said, thanks to this forum and being VERY CAREFUL with what I do - I have fixed my own errors. The latest from right here with Ysanmiguel and kp52.

                    Thank you so much!
                      • 33238
                      • 388 Posts
                      Your Welcome my friend!
                        --
                        ysanmiguel.com