SiteSearch

Adds global search capabilities to October CMS

Back to SiteSearch Support

forums7529
forums7529

This plugin has been working absolutely brilliantly, until I upgraded to the Production version of October CMS.

Now all searches result in 'An exception has been thrown during the rendering of a template ("Undefined index: url").'.

I'd be very grateful for any help with overcoming this issue.

Many thanks.

OFFLINE
OFFLINE

Hi, thanks for your messsage.

Could you give me the full error message with the file and line number? Also, what search providers are you using? Could you try disabling them one by one in the backend to see if it is a specific provider that's causing the issue?

Last updated

forums7529
forums7529

Hi,

Wow, thank you so much for the quick reply, really appreciated.

The exception is being thrown at /partials/searchResults/default.htm line 1

{% set results = SELF.results %}

{% for result in results %} {# Display all results #} {% partial SELF ~ '::searchresult.htm' result = result %} {% else %} {# No results found #} {% partial SELF ~ '::no-results.htm' %} {% endfor %}

{% partial SELF ~ '::pagination.htm' results = results %}

I've tried systematically disabling each provider, but it seems to be a general error. Many thanks for your help.

Last updated

OFFLINE
OFFLINE

Please edit the file plugins/offline/sitesearch/components/SearchResults.php, in the results method, right before the return statement add dd($this->page->settings); and reload your search page. Could you post the output of that here?

    // Edit the results method to look like this
    public function results()
    {
        $paginator = new LengthAwarePaginator(
            $this->getPaginatorSlice($this->resultCollection),
            $this->resultCollection->count(),
            $this->resultsPerPage,
            $this->pageNumber
        );

        // Add this line
        dd($this->page->settings);

        return $paginator->setPath(\Url::to($this->page->settings['url']))->appends('q', $this->query);
    }

Last updated

forums7529
forums7529

Thanks again for your reply. I've done that and it outputs the following:-

Search results for education

array:6 [▼ "components" => [] "title" => "Search results" "layout" => "default" "meta_title" => null "meta_description" => null "is_hidden" => "0" ]

Thanks again.

OFFLINE
OFFLINE

Strange... you did put the component on a cms page right, not on to a layout directly? What is the URL of the search results page?

If you open your search results page htm file in an editor, what are the first few lines? Do they look like this? Is an url attribute present?

title = "Search results"
url = "/search"
layout = "default"
is_hidden = 0

Last updated

forums7529
forums7529

Yes, it's actually on a Static Page, using a snippet.

I was all working absolutely perfectly on the previous version of October.

forums7529
forums7529

OFFLINE said:

Strange... you did put the component on a cms page right, not on to a layout directly? What is the URL of the search results page?

If you open your search results page htm file in an editor, what are the first few lines? Do they look like this? Is an url attribute present?

title = "Search results"
url = "/search"
layout = "default"
is_hidden = 0

Yes, looks exactly like the above, thanks.

OFFLINE
OFFLINE

I just released version 1.2.9. Please check if this bug is fixed.

Thanks for your cooperation!

forums7529
forums7529

Oh you absolute superstar !!!!

That's completely fixed it.

Thank you so much for your help and I hope it's helped others too.

Thanks again.

1-10 of 10