Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/Common/Solr/SolrSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ public function submit($start, $rows, $processResults = true)
$searchResult['highlight'] = $doc['highlight'];
$searchResult['highlight_word'] = preg_replace('/^;|;$/', '', // remove ; at beginning or end
preg_replace('/;+/', ';', // replace any multiple of ; with a single ;
preg_replace('/[{~\d*}{\s+}{^=*\d+.*\d*}`~!@#$%\^&*()_|+-=?;:\'",.<>\{\}\[\]\\\]/', ';', $this->searchParams['query']))); // replace search operators and special characters with ;
preg_replace('/[{~\d*}{\s+}{^=*\d+.*\d*}{\sAND\s}{\sOR\s}{\sNOT\s}`~!@#$%\^&*()_|+-=?;:\'",.<>\{\}\[\]\\\]/', ';', $this->searchParams['query']))); // replace search operators and special characters with ;
}
$documents[$doc['uid']]['searchResults'][] = $searchResult;
}
Expand Down
10 changes: 8 additions & 2 deletions Classes/Domain/Repository/DocumentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,10 @@ public function getPreviousDocumentUid($uid)
return $prevDocument['uid'];
}

return $this->getLastChild($this->getPreviousDocumentUid($parentId));
$previousDocumentId = $this->getPreviousDocumentUid($parentId);
if ($previousDocumentId) {
return $this->getLastChild($previousDocumentId);
}
}
}

Expand Down Expand Up @@ -727,7 +730,10 @@ public function getNextDocumentUid($uid)
return $nextDocument['uid'];
}

return $this->getFirstChild($this->getNextDocumentUid($parentId));
$nextDocumentId = $this->getNextDocumentUid($parentId);
if ($nextDocumentId) {
return $this->getFirstChild($nextDocumentId);
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion Classes/Middleware/SearchInDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
[
'tx_dlf[id]' => !empty($resultDocument->getUid()) ? $resultDocument->getUid() : $parameters['uid'],
'tx_dlf[page]' => $resultDocument->getPage(),
'tx_dlf[highlight_word]' => $parameters['q']
'tx_dlf[highlight_word]' => preg_replace('/^;|;$/', '', // remove ; at beginning or end
preg_replace('/;+/', ';', // replace any multiple of ; with a single ;
preg_replace('/[{~\d*}{\s+}{^=*\d+.*\d*}{\sAND\s}{\sOR\s}{\sNOT\s}`~!@#$%\^&*()_|+-=?;:\'",.<>\{\}\[\]\\\]/', ';', $parameters['q']))) // replace search operators and special characters with ;
]
);

Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/PageView/SearchInDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ function triggerSearchAfterHitLoad() {

if(searchedQueryParam && decodeURIComponent(queryParam[0]).indexOf(searchedQueryParam) !== -1) {
$("input[id='tx-dlf-search-in-document-query']").val(decodeURIComponent(queryParam[1]));
$("#tx-dlf-search-in-document-form").submit();
//$("#tx-dlf-search-in-document-form").submit();
break;
}
}
Expand Down