SOLVED: Navigation block plugin (search) not working correctly after update to

I have been made aware that on one of our instances the search block in the navigation does not seem to work correctly. I boiled it down to the fact that the template does not get the path right to execute the search.

On our working instance the source code of the website looks like this:

while the faulty site produces this:

They are both hosted on the same server and the block.tpl file is identical for both:

<div class="block" id="sidebarNavigation">
<span class="blockTitle">{translate key="plugins.block.navigation.journalContent"}</span>

{url|assign:"searchFormUrl" op="search" escape=false}
<form id="simplesearchForm" action="{$searchFormUrl|strtok:"?"|escape}">
	{foreach from=$formUrlParameters key=paramKey item=paramValue}
		<input type="hidden" name="{$paramKey|escape}" value="{$paramValue|escape}"/>
	<table id="simpleSearchInput">
			{capture assign="filterInput"}{call_hook name="Templates::Search::SearchResults::FilterInput" filterName="simpleQuery" filterValue="" size=15}{/capture}
			{if empty($filterInput)}
				<label for="simpleQuery">{translate key=""} <br />
				<input type="text" id="simpleQuery" name="simpleQuery" size="15" maxlength="255" value="" class="textField" /></label>
			<td><label for="searchField">
			{translate key="plugins.block.navigation.searchScope"}
			<br />
			<select id="searchField" name="searchField" size="1" class="selectMenu">
				{html_options_translate options=$articleSearchByOptions}
			<td><input type="submit" value="{translate key=""}" class="button" /></td>

<br />

{if $currentJournal}
<span class="blockSubtitle">{translate key="navigation.browse"}</span>
	<li><a href="{url page="issue" op="archive"}">{translate key="navigation.browseByIssue"}</a></li>
	<li><a href="{url page="search" op="authors"}">{translate key="navigation.browseByAuthor"}</a></li>
	<li><a href="{url page="search" op="titles"}">{translate key="navigation.browseByTitle"}</a></li>
	{call_hook name="Plugins::Blocks::Navigation::BrowseBy"}
	{if $hasOtherJournals}
		<li><a href="{url journal="index"}">{translate key="navigation.otherJournals"}</a></li>
		{if $siteCategoriesEnabled}<li><a href="{url journal="index" page="search" op="categories"}">{translate key="navigation.categories"}</a></li>{/if}

So for whatever reason the same code on the same server resolves {$searchFormUrl|strtok:"?"|escape} one time into and one the other instance into*/search where * could be “index” or “about” or “issue” depending which site I am on.

If nothing else works could I hardcode into the block.tpl to make it work?

Thanks for the help!

See this issue and fix, scheduled against 2.4.9:

1 Like

Worked like a charm. Thank you very much! I am still baffled though that the other site does not experience this behavior while being hosted on the same server and all…