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

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}
{$searchFormUrl|parse_url:$smarty.const.PHP_URL_QUERY|parse_str:$formUrlParameters}
<form id="simplesearchForm" action="{$searchFormUrl|strtok:"?"|escape}">
	{foreach from=$formUrlParameters key=paramKey item=paramValue}
		<input type="hidden" name="{$paramKey|escape}" value="{$paramValue|escape}"/>
	{/foreach}
	<table id="simpleSearchInput">
		<tr>
			<td>
			{capture assign="filterInput"}{call_hook name="Templates::Search::SearchResults::FilterInput" filterName="simpleQuery" filterValue="" size=15}{/capture}
			{if empty($filterInput)}
				<label for="simpleQuery">{translate key="navigation.search"} <br />
				<input type="text" id="simpleQuery" name="simpleQuery" size="15" maxlength="255" value="" class="textField" /></label>
			{else}
				{$filterInput}
			{/if}
			</td>
		</tr>
		<tr>
			<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}
			</select></label>
			</td>
		</tr>
		<tr>
			<td><input type="submit" value="{translate key="common.search"}" class="button" /></td>
		</tr>
	</table>
</form>

<br />

{if $currentJournal}
<span class="blockSubtitle">{translate key="navigation.browse"}</span>
<ul>
	<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}
	{/if}
</ul>
{/if}

So for whatever reason the same code on the same server resolves {$searchFormUrl|strtok:"?"|escape} one time into http://www.zjapanr.de/index.php/zjapanr/search/search and one the other instance into http://zchinr.de/index.php/zchinr/*/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:
https://github.com/pkp/pkp-lib/issues/2442

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…