We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44140
    • 25 Posts
    I'm putting together a new site, and there are a few issues. The biggest one (a real showstopper) is with getResources and using &where.

    It seems that it is not working at all. Whatever I place in &where all of the resources are returned.

    eg.

    [[!getResources? &parents=`[[*id]]` &where=`{"template:=":8}` &tpl=`mytemplate`]]


    Returns the full list of resources, when there is no template equaling 8.

    I've even tried copying and pasting several different &where statements from the online documentation and none of them make a blind bit of difference; every resource is returned.

    I've looked back and forth through the documentation, on the forums etc etc, gone round and round in circles on this, but to no avail.

    I'm using MODX Revolution 2.5.0-pl on Debian Stable (Jessie), MySQL 5.5.49, PHP 5.6.22.


    PS. I've put this question here since I cannot find any information about getResources and where to send bugs/questions.

    EDITED TO ADD

    List of extras installed

    Archivist 1.2.4-pl
    Collections 3.4.2-pl
    getDate 1.0.0-pl
    getPage 1.2.4-pl
    getResources 1.6.1-pl
    lessCSS 1.3-pl
    Markdown Editor 1.1.0-pl
    oEmbed 0.2.2-pl
    pdoTools 2.5.3-pl
    Tagger 1.7.0-pl

    I've even had a go with pdoResources (hence pdoTools in the list above), but with the same results.

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

    [ed. note: ecadre last edited this post 7 years, 11 months ago.]
      • 44140
      • 25 Posts
      OK, an update. I had an experiment on my desktop box (running Debian Sid), and installed a fresh Modx 2.5. I then installed getResources, and created a few resources,

      Lo and behold, &where worked in getResources.

      Then I installed all of the plugins in the list above ... and &where stopped working.

      I reinstalled getResources (I even removed it and reinstalled it from scratch), but it still did not work.

      I then uninstalled and removed the packages one at a time, retrying my test page each time, but with no luck.

      All that can say is that it seems one of these packages may change something that screws up getResources.

      EDITED TO ADD

      Now I'm really getting dispirited about this. I just went through the rigmarole of resetting Modx on my box and installing and testing each package in turn, in the order that they are listed above. I left out pdotools second from the end (because it wasn't installed when I had the original problem) and went straight on to tagger.

      &where worked all the way through right to the end. A little perplexed, I decided to install pdotools after all ... and then &where stopped working. [ed. note: ecadre last edited this post 7 years, 11 months ago.]
        • 44140
        • 25 Posts
        I have found getResources on Github and have entered a bug report:

        https://github.com/opengeek/getResources/issues/102

        I note, however, that none of the bug reports have been responded to by a developer or closed since 2013. [ed. note: ecadre last edited this post 7 years, 11 months ago.]
          • 3749
          • 24,544 Posts
          From your description, I'd say the problem is not with getResources, which if I'm understanding you, worked fine until you installed pdoTools. Since pdoTools is a replacement for getResources, I don't see why you'd need both.

          That said, I can't think of any reason installing pdoTools would cause trouble with getResources unless you happened to have a collision on one of the default Tpl chunks (which you shouldn't be using), or you've created some other custom feature that's colliding with pdoTools.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 44140
            • 25 Posts
            Quote from: BobRay at Jun 18, 2016, 08:31 PM
            From your description, I'd say the problem is not with getResources, which if I'm understanding you, worked fine until you installed pdoTools. Since pdoTools is a replacement for getResources, I don't see why you'd need both.

            That said, I can't think of any reason installing pdoTools would cause trouble with getResources unless you happened to have a collision on one of the default Tpl chunks (which you shouldn't be using), or you've created some other custom feature that's colliding with pdoTools.

            Thanks for the reply smiley

            The first time it happened (on my remote server running Debian stable), pdotools was not installed.

            The second time (on my desktop running Debian Unstable/Sid), pdotools was not installed at that point.

            The third time it happened (again on my desktop box), it appeared to happen after installing pdotools, but given the above I seriously doubt that it had anything to do with pdotools as such.

            Sadly, getresources (or pdoresources) are fundamental to what I need to do with this website and right now everything is on hold with time running out :-/

            EDITED TO ADD:

            I installed pdotools so that I could try to use pdoResources, hoping it would not exhibit the same problem that getResources did. Unfortunately it does.
              • 3749
              • 24,544 Posts
              Is that your exact, full getResources tab above?

              Did you try this:


              &where=`{"template:=":"8"}`
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 44140
                • 25 Posts
                Quote from: BobRay at Jun 19, 2016, 03:13 AM
                Is that your exact, full getResources tab above?

                Did you try this:


                &where=`{"template:=":"8"}`

                Yes, amongst other things. It gives the same result as the unquoted one.

                Thing is, both were working before ... well, I think you get the drill.

                I've got a little bit of time this morning (actually not, but I'm pretending) before being whisked off to a recording studio (not that you needed to know that bit), so I am going to install 2.4.4-pl onto my desktop box and see what happens.

                EDITED TO ADD

                Done. Installed Modx 2.4.4-pl and got precisely the same bug.

                btw. I installed pdoTools at the beginning with getResources, and they both worked. Installed the other Extras and neither worked correctly with &where. [ed. note: ecadre last edited this post 7 years, 11 months ago.]
                  • 4172
                  • 5,888 Posts
                  Interesting issue. Never have heard or seen an issue like that and can't think, what could cause it.
                  Any chance to get manager-access to an installation, where this happens?
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 3749
                    • 24,544 Posts
                    I assume that you've tried repairing all tables in the DB, then manually deleting the core/cache files?
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 44140
                      • 25 Posts
                      Quote from: Bruno17 at Jun 19, 2016, 01:17 PM
                      Interesting issue. Never have heard or seen an issue like that and can't think, what could cause it.
                      Any chance to get manager-access to an installation, where this happens?

                      Yes, of course. There's nothing to lose.

                      What would be the best way to arrange this? I could just make a new administrators account and PM the details.