We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28107
    • 230 Posts
    I'm stuck. MODX 2.2.14, all used plugins are updated

    I generate a list of resources filtered via a TV usign getResources or pdoResources ...

    There is a TV (Radio Buttons with Value Yes==1||No==2 )

    [[!getResources?
       &parents=`-1` 
       &limit=`2`
    
       &hideContainers=`0`
    
       &processTVs=`1`
       &includeTVs=`1`
       &includeTVList =`yn-showlink`
    
       &tpl=`chunk-link`  
       &where=`{"yn-showlink:=":1}`
    ]]
    


    gives me a
    [2014-04-26 15:55:52] (ERROR @ /index.php) Error 42S22 executing statement: 
    Array
    (
        [0] => 42S22
        [1] => 1054
        [2] => Unknown column 'modResource.yn-showlink' in 'where clause'
    )


    That works on a different machine/hoster.

    Here on this server where the shit happens, filtering via TVs does not work.
    Servers are as far as I can tell nearly identical (mysql, php versions)

    Any ideas are really appreciated.
      CONIN Werbeagentur . Köln
      http://www.conin.de
      • 38415 ☆ A M B ☆
      • 70 Posts
      Mac, take a breath! smiley

      [[!getResources?
         &parents=`-1` 
         &limit=`2`
       
         &hideContainers=`0`
       
         &processTVs=`1`
         &includeTVs=`1`
         &includeTVList =`yn-showlink`
       
         &tpl=`chunk-link`  
         &tvFilters=`yn-showlink===1`
      ]]


      You must use &tvFilters when you filter by TVs, instead of &where (works only for resource fields, not TVs).
        chsmedien - Digital Marketing Agency
        MODX Professional & Ambassador

        http://chsmedien.com | http://twitter.com/christianseel
        • 28107
        • 230 Posts
        tried that also before. I do get nothing if I'm filtering.
        even stranger:
        getResources delivers nothing, pdoResources does, but not with filtering.

        And I swear: in an other installation the filtering with 'where' and TVs does work.

        I'll check now the installed modx components if there is something missing.
          CONIN Werbeagentur . Köln
          http://www.conin.de
          • 38415 ☆ A M B ☆
          • 70 Posts
          There's a 2nd issue I guess:

          Why are using &parents=`-1` ? This would require to set &resources=`` (filled with single resource IDs). So please test &parents=`0` (MODX root) and &tvFilters.
            chsmedien - Digital Marketing Agency
            MODX Professional & Ambassador

            http://chsmedien.com | http://twitter.com/christianseel
            • 28107
            • 230 Posts
            ok, its definitely the parents that causes the trouble.

            and: with parents=0 also the &where filtering (with pdoResources) works.

            So my next task is to check why in heaven the other installation requires a -1 for the parents..


            conclusion: Parents are always a big problem ... smiley [ed. note: spackko last edited this post 12 years, 5 months ago.]
              CONIN Werbeagentur . Köln
              http://www.conin.de
              • 28107
              • 230 Posts
              Quote from: spackko at Apr 26, 2014, 11:08 AM
              ok, getresources wants to have
              &parents=`0`


              that does work.


              pdoResources also .... O_O

              seems to be a voodoo day ..
              And again, that other workes only with
              &parents=`-1`
              everything else failed there.

              OK problem solved for the moment. thx and a beer is waiting for you.
                CONIN Werbeagentur . Köln
                http://www.conin.de