Skip to content

Commit

Permalink
[TASK] Remove duplicate code in facet link builder
Browse files Browse the repository at this point in the history
Change-Id: I9a4c6767bb02727b82a91ea25661a0ff4383efa0
  • Loading branch information
saschanowak authored and irnnr committed Jun 25, 2015
1 parent 6dff517 commit a2ff9e4
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions Classes/Query/LinkBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,34 +244,14 @@ public function getQueryLink($linkText, array $additionalQueryParameters = array
* @return string A query URL
*/
public function getQueryUrl(array $additionalQueryParameters = array(), array $typolinkOptions = array()) {
$queryParameters = array_merge(
$this->getPluginParameters(),
$additionalQueryParameters
);
$queryParameters = $this->removeUnwantedUrlParameters($queryParameters);

$queryKeywords = '';
if ($this->query) {
$queryKeywords = $this->query->getKeywords();
}
$queryGetParameter = '';
if (!empty($queryKeywords)) {
$queryGetParameter = '&q=' . $queryKeywords;
}

$linkConfiguration = array(
'useCacheHash' => FALSE,
'no_cache' => FALSE,
'parameter' => $this->linkTargetPageId,
'additionalParams' => $queryGetParameter
. t3lib_div::implodeArrayForUrl('', array($this->prefix => $queryParameters), '', TRUE)
. $this->getUrlParameters()
$linkConfigurationOverwrite = array('returnLast' => 'url');
$link = $this->getQueryLink(
'',
$additionalQueryParameters,
array_merge($typolinkOptions, $linkConfigurationOverwrite)
);

// merge linkConfiguration with typolinkOptions
$linkConfiguration = array_merge($linkConfiguration, $typolinkOptions);

return htmlspecialchars($this->contentObject->typoLink_URL($linkConfiguration));
return htmlspecialchars($link);
}

/**
Expand Down

1 comment on commit a2ff9e4

@Mabahe
Copy link
Contributor

@Mabahe Mabahe commented on a2ff9e4 Nov 3, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

causes regression. see #104

Please sign in to comment.