We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37984
    • 215 Posts
    jgrant - you're the man. Your fix appears to have worked for me. Thank you!
      Jesse Couch
      MODX Aficionado, Front-End Designer & Developer
      http://www.designcouch.com
      • 33969
      • 60 Posts
      Another 'tip of the hat' to Fi1osof for finding the fix and to jgrant for posting it here.

      Happiness is an empty 'Error Log' ;-)
        Michael Regan
        TIMR Web Services
        Phone: 250.218.5284
        Eamil: [email protected]
        Website: timr.ca
        • 42046
        • 436 Posts
        Quote from: jgrant at Mar 04, 2013, 08:33 PM
        That is, create a plugin bound to onHandleRequest and put this line in it:
        $modx->loadClass('sources.modMediaSource');

        Which explicitly loads the class.

        I'm getting this behaviour with a getResrouces call to Gallery, which caused the browser to go into a loop after a set number of images flicking though a gallery.

        The fix above doesn't solve the issue but produces another error:

        (ERROR @ /connectors/element/plugin.php) modPluginEvent: Attempt to set NOT NULL field priority to NULL


        Any ideas?
          • 33969
          • 60 Posts
          I looked at using getResources to call Gallery, but didn't think it would work. I didn't think it would pass the references properly.

          If your browser is going into a loop I would think either getResources or Gallery is not seeing a required value - which is basically what the error message says.
            Michael Regan
            TIMR Web Services
            Phone: 250.218.5284
            Eamil: [email protected]
            Website: timr.ca
            • 42046
            • 436 Posts
            Quote from: timrca at Mar 06, 2013, 02:30 PM
            If your browser is going into a loop I would think either getResources or Gallery is not seeing a required value - which is basically what the error message says.

            Turns out the browser loop was related to PrettyPhoto. Switched over to FancyBox and it resolved the issue. First tried the sekFancyBox add-on but it caused performance issues, so implemented the standard FancyBox.
              • 34163
              • 11 Posts
              Quote from: jgrant at Mar 04, 2013, 08:33 PM
              ...That is, create a plugin bound to onHandleRequest and put this line in it:
              $modx->loadClass('sources.modMediaSource');

              Which explicitly loads the class.

              Would someone be able to elaborate on how to do this?

              cheers.
                • 33969
                • 60 Posts
                If you haven't written any php code before - try this on your development server or a test site first.

                The process is fairly simple.

                1 - Click on the Create Plugin icon at the top of the left menu
                2 - Give the Plugin a name - something that you will remember
                3 - Paste $modx->loadClass('sources.modMediaSource'); on the line below the <?php in the text box
                4 - In the 'System Events' tab scroll down to 'OnHandleRequest' and click the check box
                5 - Save

                Step 4 is the critical one. It binds the plugin to a system event. Without it the plugin doesn't do anything.

                There is more info on plugins at http://rtfm.modx.com/display/revolution20/Plugins
                  Michael Regan
                  TIMR Web Services
                  Phone: 250.218.5284
                  Eamil: [email protected]
                  Website: timr.ca
                  • 34163
                  • 11 Posts
                  Thanks for your help Michael, much appreciated. It appears that this workaround has stemmed the flow of messages to the error log.
                    • 9648 ☆ A M B ☆
                    • 91 Posts
                    Quote from: jgrant at Mar 04, 2013, 08:33 PM

                    Anyway, I tried a bunch of dumb ideas to no effect, then read an interesting discussion of the problem on the Russian MODX forum and gave one of Fi1osof's solutions ( http://community.modx-cms.ru/blog/9096.html#comment58216 ) a go. That is, create a plugin bound to onHandleRequest and put this line in it:
                    $modx->loadClass('sources.modMediaSource');

                    Which explicitly loads the class.
                    Glad to help.
                      MODX Revolution expert
                      Follow ME on Twitter | Feel free ask any question on MODX-club