We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16183
    • 1,390 Posts
    Quote from: Seel-Media at Sep 03, 2009, 05:04 PM

    well, now i had an error when i use ditto in a document.
    this is the error when i use wayfinder2.5 before ditto.
    Fatal error: Cannot redeclare class Wayfinder in /www/htdocs/w009bd14/Kunden/Centiveo/web/assets/snippets/wayfinder25/Wayfinder.class.php on line 10


    when ditto stands befor wayfinder in the code, i had this error:
    Fatal error: Cannot redeclare class prePHx in /www/htdocs/w009bd14/Kunden/Centiveo/web/assets/snippets/ditto/classes/phx.pre.class.inc.php on line 11

    the ditto tpl contains no phx-call. whenn i escape the all wayfinder-calls, ditto is working.
    so there must be a problem with wayfinder+phx and ditto...

    can anybody help?

    The answer’s right here on this thread, the 2nd page smiley

    http://modxcms.com/forums/index.php/topic,33904.msg221084.html#msg221084

    cheers/k
      • 26575
      • 57 Posts
      christianseel Reply #62, 17 years ago
      sorry, didn’t reed the posts again...
      thanks for your help!
        christian seel - www.christianseel.com
        web developer & designer at chsmedien.de
        twitter: @christianseel / @chsmedien
        • 13428 ☆ A M B ☆
        • 1,031 Posts
        Quote from: FuryDE at Jun 10, 2009, 04:52 AM

        Quote from: kongondo at May 13, 2009, 01:07 PM

        is WF beta 2.5 phx clashing with ditto’s phx.pre.class..?

        Fatal error: Cannot redeclare class prePHx in C:\wamp\www\modxtests\assets\snippets\ditto\classes\phx.pre.class.inc.php on line 11

        Hello! As I’m having the same problem and I’ve solved it (or mayber worked around). Here is my soultion:
        As we can see, the error is thrown from within Ditto, not Wayfinder. So we have to avoid redeclaring the class in Ditto. This can be done in the snippet definition in the manager [...]

        This was not the solution for my template because Wayfinder is called there before Ditto - the PrePHX class is defined twice by Ditto then. I had to patch the phx.pre.class.inc.php of Wayfinder with a different classname

        Line 11:
        class wfPrePHx {


        Line 14:
        function wfPrePHx($template = '') {
        


        And the Wayfinder.class.php too

        Line 353:
        $phx = new wfPrePHx($chunk);

          • 31955
          • 84 Posts
          two questions before trying to install this:

          1. is there some approximate timeframe for the final release?
          2. if I limit myself to the more basic functions of wayfinder (no phx, no ignoresecurity, etc), is the 2.5 beta2 ok to use in prod. environment?

          because if not, I might be able to patch in the function I need (even/odd classes) manually.

          thanks!
            • 27749
            • 53 Posts
            Hi,
            I realized that using WF 2.5 and Ditto somehow prevents modx from displaying the page on the first time it renders. After being cached all goes fine. Switching to WF 2.0 solves the issue, so I guess its some Ditto-WF problem.
            (modx 1.0.3)
              • 17851
              • 213 Posts
              My page calls WF twice (top nav and side nav) and Ditto once (footer links). So I used the prescribed solution in this thread:

              if ($phx  && !class_Exists("prePHx")) {


              but I had to put it in both WF and Ditto. Works great now.
                Mark Macatee
                President
                Power 10 Solutions
                http://www.power10solutions.com
                • 2762
                • 1,198 Posts
                Quote from: kylej at Mar 13, 2009, 10:40 AM


                &hereClass assigned to weblink if an internal link - http://modxcms.com/forums/index.php/topic,28461.0.html

                Does not work for me.
                [!Wayfinder2.5? &startId=`0` &level=`1` &hereClass=`here` &outerTpl=`2010.OuterTpl` &innerTpl=`2010.InnerTpl` &rowTpl=`2010.RowTpl`!]


                am i missing something?
                  Free MODx Graphic resources and Templates www.tattoocms.it
                  -----------------------------------------------------

                  MODx IT  www.modx.it
                  -----------------------------------------------------

                  bubuna.com - Web & Multimedia Design
                  • 22448
                  • 241 Posts
                  Changing Ditto to fix the problem with Wayfinder seems a bit misplaced. Fortunately the same fix works in Wayfinder snippet as as well. On line 29 change
                  if ($phx) {
                  to
                  if ($phx && !class_Exists("prePHx")) {


                  and the conflict goes away.

                  Quote from: FuryDE at Jun 10, 2009, 04:52 AM

                  Quote from: kongondo at May 13, 2009, 01:07 PM

                  is WF beta 2.5 phx clashing with ditto’s phx.pre.class..?

                  Fatal error: Cannot redeclare class prePHx in C:\wamp\www\modxtests\assets\snippets\ditto\classes\phx.pre.class.inc.php on line 11

                  Hello! As I’m having the same problem and I’ve solved it (or mayber worked around). Here is my soultion:
                  As we can see, the error is thrown from within Ditto, not Wayfinder. So we have to avoid redeclaring the class in Ditto. This can be done in the snippet definition in the manager:

                  change line 181 from
                  if ($phx == 1) {

                  to
                  if ($phx == 1 && !class_Exists("prePHx")) {


                  That’s it. The reason: Ditto builds an array of file names to be included. The change prevents loading the code for prePHX class declaration.

                  Martin
                    • 36528
                    • 3 Posts
                    Hi,
                    to make all document variables available and usable the same way as tvs (e.g. [+longtitle+] or [+pagetitle+]), I added the following lines in line 303 after the line
                    $this->addPlaceholders($phArray,'rowLevel',$resource);
                    in the Wayfinder.class.php file:
                    //Add document variables to the placeholder array
                            foreach ($resource as $dvName => $dvVal) {
                                $phArray['placeholders'][] = "[+".$dvName."+]";
                                $phArray['values'][] = $dvVal;
                            }


                    With this patch the following placeholders can be used for document variables in a row template:
                    [+id+]
                    [+menutitle+]
                    [+pagetitle+]
                    [+introtext+]
                    [+menuindex+]
                    [+published+]
                    [+hidemenu+]
                    [+parent+]
                    [+isfolder+]
                    [+description+]
                    [+alias+]
                    [+longtitle+]
                    [+type+]
                    [+content+]
                    [+template+]
                    [+link_attributes+]
                    [+privateweb+]


                    I hope you like it. smiley

                    Here’s the complete patched file:
                      • 36528
                      • 3 Posts
                      Quote from: Kiril at Jun 27, 2011, 03:19 AM

                      Quote from: FuryDE at Jun 10, 2009, 04:52 AM

                      Quote from: kongondo at May 13, 2009, 01:07 PM

                      is WF beta 2.5 phx clashing with ditto’s phx.pre.class..?

                      Fatal error: Cannot redeclare class prePHx in C:\wamp\www\modxtests\assets\snippets\ditto\classes\phx.pre.class.inc.php on line 11

                      Hello! As I’m having the same problem and I’ve solved it (or mayber worked around). Here is my soultion:
                      As we can see, the error is thrown from within Ditto, not Wayfinder. So we have to avoid redeclaring the class in Ditto. This can be done in the snippet definition in the manager:

                      change line 181 from
                      if ($phx == 1) {

                      to
                      if ($phx == 1 && !class_Exists("prePHx")) {


                      That’s it. The reason: Ditto builds an array of file names to be included. The change prevents loading the code for prePHX class declaration.

                      Martin
                      Changing Ditto to fix the problem with Wayfinder seems a bit misplaced. Fortunately the same fix works in Wayfinder snippet as as well. On line 29 change
                      if ($phx) {
                      to
                      if ($phx && !class_Exists("prePHx")) {


                      and the conflict goes away.

                      Changing the line in the wayfinder snippet did not work for me.
                      I think it depends on the order of the snippet calls and both snippets, ditto and wayfinder, (and all other snippets which use that class) have to be changed to avoid that error message.