We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34004
    • 125 Posts
    Hi All,

    I'm attempting to search a custom table. I've followed http://www.revo.wangba.fr/custom-package-dvd-shop/ to the letter and can't seem to get it to work.

    Heres the hook snippet:
    $main = array(
        'package' => 'ccdata',
        'packagePath' => '{core_path}components/ccdata/model/',
        'class' => 'PlayPanels',
        'fields' => 'District, Address', // displayed
        'withFields' => 'District, Address', // where we do the search
        'sortby' => 'PlayPanels.District DESC, PlayPanels.Address ASC'
    
    );
    
    
    
    
    // set the query hook declaration
    $qhDeclaration = array(
        'qhVersion' => '1.2',       // version of queryHook - to manage futures changes
    	   'main' => $main,
    );
    
    $hook->setQueryHook($qhDeclaration);
    
    return true;
    


    Does anyone know where to look for errors that may be happening? The error log is clean. If I change the name of the class PlayPanels to something else I see an error in the log:

     (ERROR @ /~ccplay/index.php) Could not load class PlayPanelss


    so I know PlayPanels is loading correctly, however I always get no results. I am searching for strings within the "District" column.

    Any ideas?

      • 34004
      • 125 Posts
      Coricio saves the day, added this commit to solve my issue. https://github.com/Coroico/AdvSearch/commit/a5a042036b6513699eb0f4a225670445aa529de5

      Issue was I was using bobs build script at http://bobsguides.com/custom-db-tables.html which excludes the table prefix (in this case cc_) from the package class.

      So now you can add 'tablePrefix' => 'cc_' to the $main array.

      Thanks Brunaud. Amazing response too, solved very quickly!
      • I was going to ask right now the same.
        Saved me the pain. Thanks.

        Quote from: ficklelife at Sep 09, 2012, 09:58 AM
        Coricio saves the day, added this commit to solve my issue. https://github.com/Coroico/AdvSearch/commit/a5a042036b6513699eb0f4a225670445aa529de5

        Issue was I was using bobs build script at http://bobsguides.com/custom-db-tables.html which excludes the table prefix (in this case cc_) from the package class.

        So now you can add 'tablePrefix' => 'cc_' to the $main array.

        Thanks Brunaud. Amazing response too, solved very quickly!
        • Along with MIGx / MIGXdb, AdvSearch comes very handy for creating and displaying data from Custom Packages.
          Applied the fix for tablePrefix and worked like a charm.

          Hope the author updates soon this Extra in the modx.com/extras repository so this fix doesn't get lost in my next update.

          Cheers.

          Pablo