We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10169
    • 24 Posts
    Sorry, Tim... I’m making this clear as mud. embarrassed

    When I was testing earlier, the TV containing the search term was not in the list of fields being searched, so obviously it didn’t cause any problems for me. I should have caught that earlier.

    The bottom line is that if I search for any term that exists within a defined search field of a document for which I do not have view permissions, my search results page is rendered blank, with neither template nor content displayed (though it does contain the plain-text debug output).

    If I am logged in, all search results display normally as expected.

    For the record, I am running MODx 2.0.8-pl (traditional) with php 5.3.3, MySQL 5.1.49, and Apache 2.2.16 on Ubuntu 10.10.

    Thanks,

    -Mike
      • 30023
      • 172 Posts
      As I follow it then, when the searched-for text is in (and only in) a private page to which you don’t have access, you get no output. This only occurs when the searched-for text is in one of the defined search fields.

      OK. Two quick questions.

      1) Does it make any difference if the searched-for text is in a resource field or TV? To clarify, by ’resource field’ I mean any of the standard content fields. By ’TV’ I mean one of the TVs you have defined yourself. I clarify this as very often ’TV’ is used to refer to resource fields also.

      2) Look at the bottom of the snippet code. You’ll see some Javascript. Does this appear in your ’blank’ page output? I ask this mainly to try and work out if the snippet completes execution to the end, but with no visible output, or if it is halting prematurely.

      -- Tim.

        • 10169
        • 24 Posts
        1) Does it make any difference if the searched-for text is in a resource field or TV? To clarify, by ’resource field’ I mean any of the standard content fields. By ’TV’ I mean one of the TVs you have defined yourself. I clarify this as very often ’TV’ is used to refer to resource fields also.
        The result is the same for a TV as it is for a resource field (assuming that the TV is added via the searchFields parameter).

        2) Look at the bottom of the snippet code. You’ll see some Javascript. Does this appear in your ’blank’ page output? I ask this mainly to try and work out if the snippet completes execution to the end, but with no visible output, or if it is halting prematurely.
        No, the Javascript is not there. In fact, the page source only contains the debug text... no head, body, or other code whatsoever.

        -Mike
          • 30023
          • 172 Posts

          I’ll PM to cut down on the tooing and froing on this thread.

          We can post the solution later!

          -- Tim.
            • 30023
            • 172 Posts
            Quote from: TimGS at Mar 11, 2011, 07:48 PM


            I’ll PM to cut down on the tooing and froing on this thread.

            We can post the solution later!

            -- Tim.


            Although many appear to have my search code working fine on Revo, it does need improving for Revo on some sites (including ’large’ ones). However I have no personal incentive to do this as I’ve decided to not use Revo, so sorry folks, but I’m not that altruistic!

            See http://timspencerweb.co.uk/modx-search. I’ll try to offer limited support to Revo 2.0 users, but ultimately this and anything else that is major will be down to Revo users to either
            (a) sort out yourselves in the spirit of open source software - I’d be pleased to update the code as available on my website accordingly if anyone contributes.
            (b) contact me, or someone else, about sorting this out on a commercial basis (there are others more familiar with the Revo API than I am).

            The known issue is that the function getAllTVoutputs($docid, $published) in my code which partially emulates Evo’s $modx->getTemplateVarOutput() is both slow for large sites, and in certain circumstances fails. Write a better version than I have and you’ve cracked it. The rest of the search code is AFAIK fine for Revo 2.0.

            -- Tim.