We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37143
    • 74 Posts
    Hi, so just upgraded from a 2.2.10 site to 2.4.2, and updated AdvSearch in the process.

    I started seeing this error for each page load, and realized my search functionality no longer works.

    (ERROR @ /index.php) `[[+landing]]` is not a valid integer and may not be passed to makeUrl()

    My AdvSearch setup is as follows:

    [[!AdvSearchForm? &landing=`22` &addJQuery=`0` &tpl=`TopSearchForm` ]]

    TPL:
    <form id="[[+asId]]_advsea-form" class="advsea-form" action="[[~[[+landing]]]]" method="[[+method]]">

    <input type="hidden" name="id" value="[[+landing]]" />
    <input type="hidden" name="asId" value="[[+asId]]" />
    <input type="text" id="[[+asId]]_advsea-search" name="[[+searchIndex]]" value="Search" onfocus="if(this.value == 'Search') { this.value = ''; }" />

    </form>
    [[+resultsWindow]]

    anyone run across this before?

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

      • 37143
      • 74 Posts
      just to follow up, if I change the form action to action="[[~22]]", I am able to avoid the makeURL() error, but my search doesn't work. My search results pages are returning urls as such:

      http://mysite.com/search-results.html?id=&asId=

      my trace stack shows the following:

      [2016-01-13 14:54:22] (ERROR @ /index.php) `[[+landing]]` is not a valid integer and may not be passed to makeUrl()
      [2016-01-13 14:54:22] (ERROR @ /index.php) #0 /home/mysite/dev/core/model/modx/modparser.class.php(1330): modX->makeUrl('[[+landing]]', '', '', '-1', Array)
      #1 /home/mysite/dev/core/model/modx/modparser.class.php(476): modLinkTag->process(NULL)
      #2 /home/mysite/dev/core/model/modx/modparser.class.php(247): modParser->processTag(Array, true)
      #3 /home/mysite/dev/core/model/modx/modchunk.class.php(118): modParser->processElementTags('[[$TopSearchFor...', '<form id="[[+as...', true, false, '[[', ']]', Array, 10)
      #4 /home/mysite/dev/core/components/advsearch/model/advsearch/advsearch.class.php(387): modChunk->process(Array)
      #5 /home/mysite/dev/core/components/advsearch/model/advsearch/advsearchform.class.php(142): AdvSearch->parseTpl('TopSearchForm', Array)
      #6 /home/mysite/dev/core/cache/includes/elements/modsnippet/88.include.cache.php(37): AdvSearchForm->output()
      #7 /home/mysite/dev/core/model/modx/modscript.class.php(70): include('/home/mysite/...')
      #8 /home/mysite/dev/core/model/modx/modparser.class.php(513): modScript->process('&landing=`22` &...')
      #9 /home/mysite/dev/core/model/modx/modparser.class.php(247): modParser->processTag(Array, true)
      #10 /home/mysite/dev/core/model/modx/modresponse.class.php(83): modParser->processElementTags('', '<!DOCTYPE html>...', true, false, '[[', ']]', Array, 10)
      #11 /home/mysite/dev/core/model/modx/modrequest.class.php(145): modResponse->outputContent(Array)
      #12 /home/mysite/dev/core/model/modx/modrequest.class.php(129): modRequest->prepareResponse()
      #13 /home/mysite/dev/core/model/modx/modx.class.php(1412): modRequest->handleRequest()
      #14 /home/mysite/dev/index.php(69): modX->handleRequest()
      #15 {main}
        • 37143
        • 74 Posts
        also, the search results snippet runs and iterates, but all placeholders are empty, including [[+pagetitle]], etc. I have them in a bulleted list, and the bullets come back on different search terms in different amounts, but the output placeholders are all empty.
        • discuss.answer
          You need to add "advsearch" placeholders into all chunks.
          It's a new thing.

          https://github.com/Coroico/AdvSearch/blob/Development/core/components/advsearch/elements/chunks/searchform.chunk.tpl
            Rico
            Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
            MODx is great, but knowing how to use it well makes it perfect!

            www.virtudraft.com

            Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

            Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

            Maintainter/contributor of Babel

            Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
            • 37143
            • 74 Posts
            Thanks goldsky! u rock!
              • 37143
              • 74 Posts
              Looks good, but this placeholder isn't returning any results. [[+advsearch.resultInfo]]

              It's definitely using the default chunk, cuz I added a css "test" class to it, and I can see it, but it comes back empty.

              <p class="advsea-results test">[[+advsearch.resultInfo]]</p>

              any ideas?



              Quote from: goldsky at Jan 14, 2016, 05:55 AM
              You need to add "advsearch" placeholders into all chunks.
              It's a new thing.

              https://github.com/Coroico/AdvSearch/blob/Development/core/components/advsearch/elements/chunks/searchform.chunk.tpl
              • It's now available as global parameter, but must be called after AdvSearch's snippet call.

                Example on resource page:
                [[!AdvSearchForm]]
                 
                <h2>Results</h2>
                [[!AdvSearch?
                &toPlaceholder=`searchResult`
                ]]
                
                <p class="advsea-results test">[[+advsearch.resultInfo]]</p>
                
                [[+searchResult]]
                
                <p class="advsea-query">[[+advsearch.query]]</p>
                <p class="advsea-total">[[+advsearch.total]]</p>
                <p class="advsea-etime">[[+advsearch.etime]]</p>
                <p class="advsea-moreResults">[[+advsearch.moreResults]]</p>
                


                Why?

                Because AdvSearch now has caching system.
                That said, previously it was always counted from query, now it can also retrieve counting from caching.

                To enable caching, change the call like this:
                [[!AdvSearch?
                &toPlaceholder=`searchResult`
                &cacheQuery=`1`
                &cacheTime=`7200`
                ]]
                

                You can find new folder core/cache/advsearch/ since then.

                Defaults are: &cacheQuery=`0` and &cacheTime=`7200`

                Notice the different numbers on advsearch.query and advsearch.etime [ed. note: goldsky last edited this post 8 years, 3 months ago.]
                  Rico
                  Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                  MODx is great, but knowing how to use it well makes it perfect!

                  www.virtudraft.com

                  Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                  Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                  Maintainter/contributor of Babel

                  Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                  • 37143
                  • 74 Posts
                  got it, thanks so much!