We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41729
    • 1 Posts
    For now just after installing got a double error repeating every site reload (and busting error.log quickly):



    "Just after installing" means no pages assigned to load via Ajax Revolution. Maybe things turns better when I start to use plugin supported ajax call, but I don't know for sure how to implement it 'cos no suitable tutorial available.

    MODX Revolution 2.2.5-pl Standard

    Quote from: fuzzicallogic at Oct 18, 2012, 08:59 AM
    I have been planning on it.
    Please!:)
    [ed. note: size_t last edited this post 13 years, 10 months ago.]
      • 38189
      • 31 Posts
      I've tried doing the tutorial done here.

      I am also aware this has been made in a transport package (which is the one I have installed at the moment and where I am having an issue with), I am also very aware that some values/variables are slightly named different to the ones in the transport package.

      -

      Now onto my little issue.

      The tutorial says to make a snippet,
      [[!testAJAXRequest]]
      I make the snippet with the following code:
      <?php
      //Get the System Setting (needed only once per Resource)
          $argsName = !empty($argsName) ? $argsName : $modx->getOption('url_params_name', null, 'urlParams');
       
      // Get an ordered Parameter 
          if (!empty($_REQUEST[$argsname][0]))
              $value = $_REQUEST[$argsname][0]; // <-- Replace # with the segment index. 
          else
              $value = 'Nothing sent';
       
          $output = '<p>' . $value . '</p>';
       
          return $output;


      I do the following changes so it works with the transport package version:<?php
      //Get the System Setting (needed only once per Resource)
          $argsName = !empty($argsName) ? $argsName : $modx->getOption('key_params', null, 'url_params');
      
      // Get an ordered Parameter 
          if (!empty($_REQUEST[$argsName][0]))
              $value = $_REQUEST[$argsName][0]; // <-- Replace # with the segment index. 
          else
              $value = 'Nothing sent';
       
          $output = '<p>' . $value . '</p>';
       
          return $output;


      I do the part with making a resource, placing the newly made snippet call within the newly created resource. I view the page and if displays the "Nothing Sent" message. I proceed to type my '/ajax/' and 'whatever' next to it so my URL bar looks like http://localhost/abcd/testpage/ajax/whatever . I hit enter waiting to be greeted by the very same "Viola!" I see in the tutorial, instead I am greeted to a 404 error in I.E. and in Chrome it redirects me to the home page of the modx installation.

      Help. Please. I was not greeted by "Viola!" (referring to the value being displayed on my browser as 'whatever' sad ) and severely disappointed by hours upon hours of getting this to work.

        • 39932
        • 483 Posts
        Tonitox,

        You are correct, the Tutorial is not the same as the Transport Package. The Transport Package is also undergoing a major change soon, as well.

        If you are getting a 404, several things may have happened:

        • Another plugin may be conflicting with AJAX Rev.
        • In cases where you are going to "abcd/ajax/whatever", "abcd" is not set as a container.
        • You may have changed the System Setting alias_ajax_page.
        • The Resource is in a separate Context, without Allow Context Forwarding to be on.

        There was, however, a bug on some versions of MODX that required a manual adjustment because it did not take System Settings of a particular type correctly. (This was a pain to find out and replicate). Just to be sure everything SHOULD be in working order, do the following:

        Step 1: Can you verify that it is finding the Resource without the "/ajax/whatever/"?
        Step 2: Can you verify that the Plugins are in the proper Event Order? The Package should already have done this, but if you installed certain packages after AJAX Revolution, they might be conflicting.
        Note: The next steps require that you check System Settings under the AJAX Revolution namespace.
        Step 3: Can you verify that you can get the System Setting "degrade_to_template" via a placeholder? (This was the bug)
        Step 4: Can you verify that you typed in the "key_params" correctly? In the current version, it should be url_params. Verify this in the System Settings, first. (I lied. It is indeed key_params.) [ed. note: fuzzicallogic last edited this post 13 years, 7 months ago.]
          Website: Extended Dialog Development Blog: on Extended Dialog
          Add-ons: AJAX Revolution, RO.IDEs Editor & Framework (in works) Utilities: Plugin Compatibility List
          Tutorials: Create Cross-Context Resources, Cross-Context AJAX Login, Template-Based Actions, Remove Extensions from URLs

          Failure is just another word for saying you didn't want to try. "It can't be done" means "I don't know how".
          • 38189
          • 31 Posts
          Quote from: fuzzicallogic at Feb 23, 2013, 01:04 AM

          Step 1: Can you verify that it is finding the Resource without the "/ajax/whatever/"?
          Step 2: Can you verify that the Plugins are in the proper Event Order? The Package should already have done this, but if you installed certain packages after AJAX Revolution, they might be conflicting.
          Note: The next steps require that you check System Settings under the AJAX Revolution namespace.
          Step 3: Can you verify that you can get the System Setting "degrade_to_template" via a placeholder? (This was the bug)
          Step 4: Can you verify that you typed in the "key_params" correctly? In the current version, it should be url_params. Verify this in the System Settings, first. (I lied. It is indeed key_params.)

          1) I don't know how I would go on about verifying that.
          2) I only have CodeMirror / getResources / & BoilerX, but to check


          • OnGetRequestType - priority 0
          • OnParseURLParameters - priority 1
          • OnDegradeGracefully - priority 0

          On the tutorial it states:


          • OnGetRequestType - priority 3
          • OnParseURLParameters - priority 4
          • OnDegradeGracefully - priority 1

          As I finish writing this post I will try those values instead.

          3) I will try, when I tried [[++ajax_alias_page]] in my jQuery post, Modx looked at me like it didn't know who that placeholder was and left it intact without change no matter where I placed, yet in the system settings that is indeed the key. edit: degrade_to_template does work and returns a value of 1.

          4) lol, yes I did.

          Btw thank you for replying. It means a lot, and for your time of course.

          ps: you mentioned the part about "abcd" not being a container. Abcd for this particular situation is the root folder of my site. So to be exact it would be mysite/testpage/.

          http://localhost/mysite/testpage/ works. The moment I add ajax or whatever little thing it goes to 404. [ed. note: tonitox2 last edited this post 13 years, 7 months ago.]
            • 39932
            • 483 Posts
            Quote from: tonitox2 at Feb 23, 2013, 02:28 AM

            2) I only have CodeMirror / getResources / & BoilerX, but to check


            • OnGetRequestType - priority 0
            • OnParseURLParameters - priority 1
            • OnDegradeGracefully - priority 0

            0 and 1 are correct. At the time of writing the tutorial, I was not aware of the other Plugin conflicts. What you must do instead is check for other Plugins that use the event (OnPageNotFound) and move their Priorities to larger than OnParseURLParameters.

            Quote from: tonitox2 at Feb 23, 2013, 02:28 AM

            4) lol, yes I did.


            ps: you mentioned the part about "abcd" not being a container. Abcd for this particular situation is the root folder of my site. So to be exact it would be mysite/testpage/.

            http://localhost/mysite/testpage/ works. The moment I add ajax or whatever little thing it goes to 404.

            And you just verified Step 1.

            Quote from: tonitox2 at Feb 23, 2013, 02:28 AM

            edit: I don't know what I did but now it is at least recognizing [[++ajax_alias_page]] but it's just returning a blank.

            THIS looks like it is the problem. 1) This should be [[++alias_ajax_page]]. 2) Make sure it is set correctly in your System Settings. If you have to, delete it and re-add it with the correct value. (ajax)

            Quote from: tonitox2 at Feb 23, 2013, 02:28 AM

            Btw thank you for replying. It means a lot, and for your time of course.

            Absolutely. I had some personal family stuffs that kept me from computing for a couple of months, but I'm always glad to help. And thank you too!
              Website: Extended Dialog Development Blog: on Extended Dialog
              Add-ons: AJAX Revolution, RO.IDEs Editor & Framework (in works) Utilities: Plugin Compatibility List
              Tutorials: Create Cross-Context Resources, Cross-Context AJAX Login, Template-Based Actions, Remove Extensions from URLs

              Failure is just another word for saying you didn't want to try. "It can't be done" means "I don't know how".
              • 24629
              • 370 Posts
                • 12893
                • 13 Posts
                I know this thread is almost 2 years old... but I am trying to get this to work on my website. I try calling [[!getURLParameters]] and nothing is outputted. I tried appending /ajax/ and /full/ to the URL (which exists) and I get a 404 error. Can someone confirm that this plugin is still working on the latest release of MODX Revolution?
                  • 39932
                  • 483 Posts
                  Quote from: ineffable at Jun 04, 2014, 11:24 PM
                  I know this thread is almost 2 years old... but I am trying to get this to work on my website. I try calling [[!getURLParameters]] and nothing is outputted. I tried appending /ajax/ and /full/ to the URL (which exists) and I get a 404 error. Can someone confirm that this plugin is still working on the latest release of MODX Revolution?

                  This still works all the way to 2.2.14 and I am using it on many MODX installations. If you need some specific help with it, send me a PM and we can set up a Skype session.
                    Website: Extended Dialog Development Blog: on Extended Dialog
                    Add-ons: AJAX Revolution, RO.IDEs Editor & Framework (in works) Utilities: Plugin Compatibility List
                    Tutorials: Create Cross-Context Resources, Cross-Context AJAX Login, Template-Based Actions, Remove Extensions from URLs

                    Failure is just another word for saying you didn't want to try. "It can't be done" means "I don't know how".
                    • 12893
                    • 13 Posts
                    Quote from: fuzzicallogic at Jun 05, 2014, 01:24 AM
                    Quote from: ineffable at Jun 04, 2014, 11:24 PM
                    I know this thread is almost 2 years old... but I am trying to get this to work on my website. I try calling [[!getURLParameters]] and nothing is outputted. I tried appending /ajax/ and /full/ to the URL (which exists) and I get a 404 error. Can someone confirm that this plugin is still working on the latest release of MODX Revolution?

                    This still works all the way to 2.2.14 and I am using it on many MODX installations. If you need some specific help with it, send me a PM and we can set up a Skype session.

                    PM sent. Thanks a lot for your help!