Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Hierarchy facet items containing dashes cannot be unset #3696

Conversation

dkd-kaehm
Copy link
Collaborator

@dkd-kaehm dkd-kaehm commented Jun 12, 2023

If you try to apply the hierarchy facet to a path of UUIDs instead of integers the facet can be selected, but not unselected anymore. This happens because the HierarchyFacetParser assumes that every value containing a dash is one that already contains the depth param. Which is not the case when dealing with uuids like /228d03bf-de44-4fcd-91fd-6ab05175fefc/901d43ca-28cf-4dbd-983d-ac96a0930530/a3f94d07-30fe-4ad1-a0cf-b5082db3aa94/.

This fix introduces a check that matches the value against the depth param pattern.

Replaces: #3070 by @tmaroschik


Todos:

  • cover this case with tests
  • make functional, because it breaks
    • HierarchyFacetParserTest::selectedOptionWithSlashInTitleOnHierarchicalFacetDoesNotBreakTheFacet
    • HierarchyFacetParserTest::facetIsActive
  • port into release-11.5.x

Broken tests:

1) ApacheSolrForTypo3\Solr\Tests\Unit\Domain\Search\ResultSet\Facets\OptionBased\Hierarchy\HierarchyFacetParserTest::selectedOptionWithSlashInTitleOnHierarchicalFacetDoesNotBreakTheFacet
Selected facet-option with slash in title/name breaks the Hierarchical facets.
Failed asserting that 0 is identical to 1.

/home/runner/work/ext-solr/ext-solr/Tests/Unit/Domain/Search/ResultSet/Facets/OptionBased/Hierarchy/HierarchyFacetParserTest.php:165
/home/runner/work/ext-solr/ext-solr/.Build/bin/phpunit:123

2) ApacheSolrForTypo3\Solr\Tests\Unit\Domain\Search\ResultSet\Facets\OptionBased\Hierarchy\HierarchyFacetParserTest::facetIsActive
Expected to have 15 sub items below path /1/14/
Failed asserting that 0 is identical to 15.

/home/runner/work/ext-solr/ext-solr/Tests/Unit/Domain/Search/ResultSet/Facets/OptionBased/Hierarchy/HierarchyFacetParserTest.php:223
/home/runner/work/ext-solr/ext-solr/.Build/bin/phpunit:123

@dkd-kaehm dkd-kaehm force-pushed the pull/3070_hierarchy_facet_dashes_restore branch from ded19a1 to 7b1cece Compare June 12, 2023 09:17
@dkd-kaehm dkd-kaehm force-pushed the pull/3070_hierarchy_facet_dashes_restore branch from 7b1cece to 32887d4 Compare October 11, 2023 08:03
If you try to apply the hierarchy facet to a path of UUIDs instead of integers the facet can be selected, but not unselected anymore. This happens because the HierarchyFacetParser assumes that every value containing a dash is one that already contains the depth param. Which is not the case when dealing with uuids like /228d03bf-de44-4fcd-91fd-6ab05175fefc/901d43ca-28cf-4dbd-983d-ac96a0930530/a3f94d07-30fe-4ad1-a0cf-b5082db3aa94/.

This fix introduces a check that matches the value against the depth param pattern.

by @tmaroschik

Replaces: TYPO3-Solr#3070
@dkd-kaehm dkd-kaehm force-pushed the pull/3070_hierarchy_facet_dashes_restore branch from 32887d4 to 5b07593 Compare December 6, 2023 11:12
@dkd-kaehm dkd-kaehm force-pushed the main branch 3 times, most recently from 363e234 to a9bae2f Compare May 17, 2024 10:41
@dkd-kaehm dkd-kaehm force-pushed the main branch 2 times, most recently from e865edc to 89d9f0d Compare July 11, 2024 17:14
@dkd-kaehm dkd-kaehm force-pushed the main branch 2 times, most recently from 16bf8c5 to dfcdd98 Compare July 30, 2024 06:38
@dkd-kaehm dkd-kaehm closed this Dec 12, 2024
@dkd-kaehm dkd-kaehm deleted the pull/3070_hierarchy_facet_dashes_restore branch December 12, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant