From 096aba8128d768cee20743572f7950cd04909df7 Mon Sep 17 00:00:00 2001
From: Jigal van Hemert <jigal.van.hemert@typo3.org>
Date: Mon, 24 Nov 2014 16:55:50 +0100
Subject: [PATCH] Revert "[BUGFIX] Unify parameter names between uri and link
 typolink Viewhelper"

This reverts commit 00df56f2e88be920e0f8324eeaeeceea261dd6dc.

Change-Id: I54eaa8fcb3096c9da2a7fcb22dc7c24a22ee58a3
Reviewed-on: http://review.typo3.org/34555
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
---
 .../Feature-59396-TypolinkViewHelper.rst       |  6 +++---
 .../ViewHelpers/Link/TypolinkViewHelper.php    | 18 +++++++++---------
 .../Link/TypolinkViewHelperTest.php            |  4 ++--
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-59396-TypolinkViewHelper.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-59396-TypolinkViewHelper.rst
index c6d0e29c1d87..5e8891791c48 100644
--- a/typo3/sysext/core/Documentation/Changelog/master/Feature-59396-TypolinkViewHelper.rst
+++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-59396-TypolinkViewHelper.rst
@@ -17,7 +17,7 @@ The full parameter usage in Fluid might look like this, where {link} is the fiel
 
 ::
 
-<f:link.typolink parameter="{link}" target="_blank" class="ico-class" title="some title" additionalParameters="&b=u" additionalAttributes="{type:'button'}">
+<f:link.typolink parameter="{link}" target="_blank" class="ico-class" title="some title" additionalParams="" additionalAttributes="{type:'button'}">
 
 ..
 
@@ -27,7 +27,7 @@ While passing additional parameters to the ViewHelper, following rules apply:
 - target is overridden, the value from Fluid applies
 - class is merged from the values passed from the database and those of *class*
 - title is overridden, the value from Fluid applies
-- additionalParameters is merged from the values passed from the database and those of *additionalParameters*
+- additionalParams is merged from the values passed from the database and those of *additionalParams*
 - additionalAttributes is (as usual) added to the resulting tag as *type="button"*
 
 {link} contains *19 _blank - "testtitle with whitespace" &X=y*.
@@ -35,7 +35,7 @@ For the given example, the output is:
 
 ::
 
-<a href="index.php?id=19&X=y&b=u" title="some title" target="_blank" class="ico-class" type="button">
+<a href="index.php?id=19&X=y" title="some title" target="_blank" class="ico-class" type="button">
 
 ..
 
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php
index 2939396b0a3e..5fa612443cd0 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php
@@ -37,7 +37,7 @@ use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
  * </code>
  *
  * <code title="Full parameter usage">
- * <f:link.typolink parameter="{link}" target="_blank" class="ico-class" title="some title" additionalParameters="&b=u" additionalAttributes="{type:'button'}">
+ * <f:link.typolink parameter="{link}" target="_blank" class="ico-class" title="some title" additionalParams="&u=b" additionalAttributes="{type:'button'}">
  * Linktext
  * </f:link.typolink>
  * </code>
@@ -57,14 +57,14 @@ class TypolinkViewHelper extends AbstractViewHelper {
 	 * @param string $target
 	 * @param string $class
 	 * @param string $title
-	 * @param string $additionalParameters
+	 * @param string $additionalParams
 	 * @param array $additionalAttributes
 	 *
 	 * @return string
 	 */
-	public function render($parameter, $target = '', $class = '', $title = '', $additionalParameters = '', $additionalAttributes = array()) {
+	public function render($parameter, $target = '', $class = '', $title = '', $additionalParams = '', $additionalAttributes = array()) {
 		// Merge the $parameter with other arguments
-		$typolinkParameter = $this->createTypolinkParameterArrayFromArguments($parameter, $target, $class, $title, $additionalParameters);
+		$typolinkParameter = $this->createTypolinkParameterArrayFromArguments($parameter, $target, $class, $title, $additionalParams);
 
 		// array(param1 -> value1, param2 -> value2) --> "param1=value1 param2=>value2" for typolink.ATagParams
 		$extraAttributes = array();
@@ -101,11 +101,11 @@ class TypolinkViewHelper extends AbstractViewHelper {
 	 * @param string $target
 	 * @param string $class
 	 * @param string $title
-	 * @param string $additionalParameters
+	 * @param string $additionalParams
 	 *
 	 * @return array Final merged typolink.parameter as array to be imploded with empty string later
 	 */
-	protected function createTypolinkParameterArrayFromArguments($parameter, $target = '', $class = '', $title = '', $additionalParameters = '') {
+	protected function createTypolinkParameterArrayFromArguments($parameter, $target = '', $class = '', $title = '', $additionalParams = '') {
 		// Explode $parameter by whitespace and remove any " around resulting array values
 		$parameterArray = GeneralUtility::unQuoteFilenames($parameter, TRUE);
 
@@ -132,9 +132,9 @@ class TypolinkViewHelper extends AbstractViewHelper {
 			$typolinkConfiguration[3] = $title;
 		}
 
-		// Combine additionalParameters
-		if ($additionalParameters) {
-			$typolinkConfiguration[4] .= $additionalParameters;
+		// Combine additionalParams
+		if ($additionalParams) {
+			$typolinkConfiguration[4] .= $additionalParams;
 		}
 
 		// Unset unused parameters again from the end, wrap all given values with "
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php
index 2938f6b546b4..b9f67d91ccdb 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php
@@ -55,7 +55,7 @@ class TypolinkViewHelperTest extends ViewHelperBaseTestcase {
 		$target = '-';
 		$class = 'fluid_class';
 		$title = 'a new title';
-		$additionalParameters = '&a=b';
+		$additionalParams = '&a=b';
 		$additionalAttributes = array(
 			'value1' => 'param1',
 			'value2' => 'par&am2', // Check htmlspecialchars is applied
@@ -72,7 +72,7 @@ class TypolinkViewHelperTest extends ViewHelperBaseTestcase {
 
 		GeneralUtility::addInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', $contentObjectRendererMock);
 
-		$subject->render($params, $target, $class, $title, $additionalParameters, $additionalAttributes);
+		$subject->render($params, $target, $class, $title, $additionalParams, $additionalAttributes);
 	}
 
 	/**
-- 
GitLab