Commit 9fafc48d authored by Thomas Löffler's avatar Thomas Löffler
Browse files

[BUGFIX] Remove exception when using not existing sorting field

parent 57708396
......@@ -37,6 +37,7 @@
"ext-zip": "*",
"ext-zlib": "*",
"apache-solr-for-typo3/solr": "^11.0",
"cweagans/composer-patches": "^1.7",
"gordalina/cachetool": "^4.0",
"nimut/testing-framework": "^5.0",
"t3o/t3olayout": "^5.0",
......@@ -70,7 +71,8 @@
"typo3/cms": {
"web-dir": "public",
"root-dir": "private"
}
},
"patches-file": "composer.patches.json"
},
"scripts": {
"test:unit": [
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "09ae5f349e500a1b6a0a55cd80ae7db9",
"content-hash": "2f9c6107720a7d61e154ece12230acf9",
"packages": [
{
"name": "adoy/fastcgi-client",
......@@ -45,16 +45,16 @@
},
{
"name": "apache-solr-for-typo3/solr",
"version": "11.0.2",
"version": "11.0.3",
"source": {
"type": "git",
"url": "https://github.com/TYPO3-Solr/ext-solr.git",
"reference": "d1a6b0f9528c934ea16cf2536527b9348e7ef9fe"
"reference": "72e46df4c4a99f8cf3fdd7d9e5b89e9b9b044ca6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/TYPO3-Solr/ext-solr/zipball/d1a6b0f9528c934ea16cf2536527b9348e7ef9fe",
"reference": "d1a6b0f9528c934ea16cf2536527b9348e7ef9fe",
"url": "https://api.github.com/repos/TYPO3-Solr/ext-solr/zipball/72e46df4c4a99f8cf3fdd7d9e5b89e9b9b044ca6",
"reference": "72e46df4c4a99f8cf3fdd7d9e5b89e9b9b044ca6",
"shasum": ""
},
"require": {
......@@ -87,6 +87,9 @@
"extension-key": "solr",
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": ".Build/Web"
},
"patches_applied": {
"Do not throw exception for wrong sorting parameter": "patches/sorting-field.diff"
}
},
"autoload": {
......@@ -122,7 +125,7 @@
"type": "custom"
}
],
"time": "2020-06-15T12:46:05+00:00"
"time": "2020-09-25T19:42:15+00:00"
},
{
"name": "causal/ig_ldap_sso_auth",
......@@ -237,6 +240,50 @@
],
"time": "2014-05-19T10:25:02+00:00"
},
{
"name": "cweagans/composer-patches",
"version": "1.7.0",
"source": {
"type": "git",
"url": "https://github.com/cweagans/composer-patches.git",
"reference": "ae02121445ad75f4eaff800cc532b5e6233e2ddf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cweagans/composer-patches/zipball/ae02121445ad75f4eaff800cc532b5e6233e2ddf",
"reference": "ae02121445ad75f4eaff800cc532b5e6233e2ddf",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0",
"php": ">=5.3.0"
},
"require-dev": {
"composer/composer": "~1.0 || ~2.0",
"phpunit/phpunit": "~4.6"
},
"type": "composer-plugin",
"extra": {
"class": "cweagans\\Composer\\Patches"
},
"autoload": {
"psr-4": {
"cweagans\\Composer\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Cameron Eagans",
"email": "me@cweagans.net"
}
],
"description": "Provides a way to patch Composer packages.",
"time": "2020-09-30T17:56:20+00:00"
},
{
"name": "doctrine/annotations",
"version": "1.10.4",
......@@ -9045,11 +9092,6 @@
"Xdebug",
"performance"
],
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/xdebug-handler/issues",
"source": "https://github.com/composer/xdebug-handler/tree/1.4.4"
},
"funding": [
{
"url": "https://packagist.com",
......@@ -9105,10 +9147,6 @@
}
],
"description": "Abstract Test Framework Adapter for Infection",
"support": {
"issues": "https://github.com/infection/abstract-testframework-adapter/issues",
"source": "https://github.com/infection/abstract-testframework-adapter/tree/0.3"
},
"time": "2020-08-30T13:50:12+00:00"
},
{
......@@ -9161,10 +9199,6 @@
}
],
"description": "Infection Extension Installer",
"support": {
"issues": "https://github.com/infection/extension-installer/issues",
"source": "https://github.com/infection/extension-installer/tree/0.1.1"
},
"time": "2020-04-25T22:40:05+00:00"
},
{
......@@ -9207,24 +9241,20 @@
}
],
"description": "Stream Wrapper: Include Interceptor. Allows to replace included (autoloaded) file with another one.",
"support": {
"issues": "https://github.com/infection/include-interceptor/issues",
"source": "https://github.com/infection/include-interceptor/tree/0.2.4"
},
"time": "2020-08-07T22:40:37+00:00"
},
{
"name": "infection/infection",
"version": "0.20.0",
"version": "0.20.1",
"source": {
"type": "git",
"url": "https://github.com/infection/infection.git",
"reference": "735506ce5fc35dd504c9ba147d5fe0554898b232"
"reference": "59a7a374e8020e362550b5223d7174ee7ccc184c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/infection/infection/zipball/735506ce5fc35dd504c9ba147d5fe0554898b232",
"reference": "735506ce5fc35dd504c9ba147d5fe0554898b232",
"url": "https://api.github.com/repos/infection/infection/zipball/59a7a374e8020e362550b5223d7174ee7ccc184c",
"reference": "59a7a374e8020e362550b5223d7174ee7ccc184c",
"shasum": ""
},
"require": {
......@@ -9322,11 +9352,7 @@
"testing",
"unit testing"
],
"support": {
"issues": "https://github.com/infection/infection/issues",
"source": "https://github.com/infection/infection/tree/0.20.0"
},
"time": "2020-10-31T19:41:12+00:00"
"time": "2020-11-03T12:14:40+00:00"
},
{
"name": "justinrainbow/json-schema",
......@@ -9392,10 +9418,6 @@
"json",
"schema"
],
"support": {
"issues": "https://github.com/justinrainbow/json-schema/issues",
"source": "https://github.com/justinrainbow/json-schema/tree/5.2.10"
},
"time": "2020-05-27T16:41:55+00:00"
},
{
......@@ -9557,34 +9579,37 @@
},
{
"name": "ocramius/package-versions",
"version": "2.1.0",
"version": "1.9.0",
"source": {
"type": "git",
"url": "https://github.com/Ocramius/PackageVersions.git",
"reference": "a7e35c34bc166a5684a1e2f13da7b1d6a821349d"
"reference": "94c9d42a466c57f91390cdd49c81313264f49d85"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/a7e35c34bc166a5684a1e2f13da7b1d6a821349d",
"reference": "a7e35c34bc166a5684a1e2f13da7b1d6a821349d",
"url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/94c9d42a466c57f91390cdd49c81313264f49d85",
"reference": "94c9d42a466c57f91390cdd49c81313264f49d85",
"shasum": ""
},
"require": {
"composer-runtime-api": "^2.0.0",
"php": "^7.4.7 || ~8.0.0"
},
"replace": {
"composer/package-versions-deprecated": "*"
"composer-plugin-api": "^1.1.0 || ^2.0",
"php": "^7.4.0"
},
"require-dev": {
"composer/composer": "^2.0.0@dev",
"doctrine/coding-standard": "^8.1.0",
"composer/composer": "^1.9.3 || ^2.0@dev",
"doctrine/coding-standard": "^7.0.2",
"ext-zip": "^1.15.0",
"infection/infection": "dev-master#8d6c4d6b15ec58d3190a78b7774a5d604ec1075a",
"phpunit/phpunit": "~9.3.11",
"vimeo/psalm": "^4.0.1"
"infection/infection": "^0.15.3",
"phpunit/phpunit": "^9.1.1",
"vimeo/psalm": "^3.9.3"
},
"type": "composer-plugin",
"extra": {
"class": "PackageVersions\\Installer",
"branch-alias": {
"dev-master": "1.99.x-dev"
}
},
"type": "library",
"autoload": {
"psr-4": {
"PackageVersions\\": "src/PackageVersions"
......@@ -9600,11 +9625,7 @@
"email": "ocramius@gmail.com"
}
],
"description": "Provides efficient querying for installed package versions (no runtime IO)",
"support": {
"issues": "https://github.com/Ocramius/PackageVersions/issues",
"source": "https://github.com/Ocramius/PackageVersions/tree/2.1.0"
},
"description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)",
"funding": [
{
"url": "https://github.com/Ocramius",
......@@ -9615,7 +9636,7 @@
"type": "tidelift"
}
],
"time": "2020-10-21T13:48:04+00:00"
"time": "2020-06-22T14:15:44+00:00"
},
{
"name": "ondram/ci-detector",
......@@ -9683,10 +9704,6 @@
"teamcity",
"travis"
],
"support": {
"issues": "https://github.com/OndraM/ci-detector/issues",
"source": "https://github.com/OndraM/ci-detector/tree/main"
},
"time": "2020-09-04T11:21:14+00:00"
},
{
......@@ -9933,10 +9950,6 @@
}
],
"description": "General-purpose collections pipeline",
"support": {
"issues": "https://github.com/sanmai/pipeline/issues",
"source": "https://github.com/sanmai/pipeline/tree/v5.1.0"
},
"funding": [
{
"url": "https://github.com/sanmai",
......@@ -9992,10 +10005,6 @@
"parser",
"validator"
],
"support": {
"issues": "https://github.com/Seldaek/jsonlint/issues",
"source": "https://github.com/Seldaek/jsonlint/tree/master"
},
"funding": [
{
"url": "https://github.com/Seldaek",
......@@ -10380,10 +10389,6 @@
"MIT"
],
"description": "PHP core functions that throw exceptions instead of returning FALSE on error",
"support": {
"issues": "https://github.com/thecodingmachine/safe/issues",
"source": "https://github.com/thecodingmachine/safe/tree/v1.3.3"
},
"time": "2020-10-28T17:51:34+00:00"
},
{
......@@ -10430,10 +10435,6 @@
}
],
"description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.",
"support": {
"issues": "https://github.com/webmozart/path-util/issues",
"source": "https://github.com/webmozart/path-util/tree/2.3.0"
},
"time": "2015-12-17T08:42:14+00:00"
}
],
......@@ -10456,5 +10457,5 @@
"platform-overrides": {
"php": "7.4.8"
},
"plugin-api-version": "2.0.0"
"plugin-api-version": "1.1.0"
}
{
"patches": {
"apache-solr-for-typo3/solr": {
"Do not throw exception for wrong sorting parameter": "patches/sorting-field.diff"
}
}
}
--- Classes/Domain/Search/ResultSet/Sorting/SortingHelper.php 2020-10-21 10:26:40.000000000 +0200
+++ Classes/Domain/Search/ResultSet/Sorting/SortingHelperNew.php 2020-10-21 10:26:52.000000000 +0200
@@ -69,12 +69,10 @@
foreach ($sortParameters as $sortParameter) {
list($sortOption, $sortDirection) = explode(' ', $sortParameter);
- if (!in_array($sortOption, $configuredSortingName)) {
- throw new \InvalidArgumentException('No sorting configuration found for option name ' . $sortOption, 1316187644);
+ if (in_array($sortOption, $configuredSortingName)) {
+ $sortField = $this->configuration[$sortOption . '.']['field'];
+ $sortFields[] = $sortField . ' ' . $sortDirection;
}
-
- $sortField = $this->configuration[$sortOption . '.']['field'];
- $sortFields[] = $sortField . ' ' . $sortDirection;
}
return implode(', ', $sortFields);
--- Classes/Search/SortingComponent.php 2020-10-21 10:32:58.000000000 +0200
+++ Classes/Search/SortingComponentNew.php 2020-10-21 10:32:58.000000000 +0200
@@ -100,7 +100,9 @@
/** @var $sortHelper SortingHelper */
$sortHelper = GeneralUtility::makeInstance(SortingHelper::class, $this->searchConfiguration['sorting.']['options.']);
$sortFields = $sortHelper->getSortFieldFromUrlParameter($arguments['sort']);
- $this->queryBuilder->useSortings(Sortings::fromString($sortFields));
+ if ($sortFields) {
+ $this->queryBuilder->useSortings(Sortings::fromString($sortFields));
+ }
$this->query = $this->queryBuilder->getQuery();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment