We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24374
    • 322 Posts
    My log is full of the following error related to the getResources snippet:

    (ERROR @ /core/cache/includes/elements/modsnippet/5.include.cache.php : 260) PHP warning: strpos() [<a href='function.strpos'>function.strpos</a>]: Offset not contained in string

    The error occurs in second line of the following block of code:

    foreach ($operators as $op => $opSymbol) {
    if (strpos($filter, $op, 1) !== false) {
    $operator = $op;
    $sqlOperator = $opSymbol;
    break;
    }
    }



    And here is the code in my script that makes the error happen:

    $output = $modx->runSnippet('getResources',array(
    'parents' => '22',
    'depth' => '1',
    'limit' => '0',
    'includeTVs' => '1',
    'tpl' => 'newsItems',
    'sortbyTV' => 'news_date',
    'sortdirTV' => 'DESC',
    'includeContent' => '1',
    'tvFilters' => '||news_section|| LIKE %||'.$id.'||%',
    'tvPrefix' => ''
    ));


    The generated output is correct, so all data is being fetched properly.




    Revo 2.3.1, getResources 1.6.1-pl [ed. note: rainbowtiger last edited this post 9 years, 9 months ago.]
      • 38090
      • 53 Posts
      I was getting this error. It has now been fixed with the latest version of the gallery module (v1.6.1)
        • 24374
        • 322 Posts
        Quote from: scorchsoft at Sep 17, 2014, 12:00 PM
        I was getting this error. It has now been fixed with the latest version of the gallery module (v1.6.1)

        I have getResources 1.6.1 installed, and I'm still getting the error. This has nothing to do with Gallery; I'm using getResources independently.
          • 3749
          • 24,544 Posts
          You might try changing &limit to `99999` and/or explicitly setting &offset=`0`.
            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