? Success

User tests: Successful: Unsuccessful:

avatar itbra
itbra
9 Jul 2014

A FinderIndexerResult may contain taxonomies. These are collected within named arrays unter the taxonomies-property like

[taxonomy:protected] => Array
(
   [collection1] => Array
   (
      [2] => JObject Object
      (
         [title]  => 2
         [state]  => 1
         [access] => 1
      )
   [collection2] => Array
   (
      [THE_NAME] => JObject Object
      (
         [title]  => THE_NAME
         [state]  => 1
         [access] => 1
      )
   )
   [YET ANOTHER COLLECTION] => Array     // underscores are replaces by blanks
   (
      [ANOTHER_NAME] => JObject Object   // underscores preserved
      (
         [title]  => ANOTHER_NAME
         [state]  => 1
         [access] => 1
      )
   )
)

As can be seen every taxonomy item (collection1, collection2, YET ANOTHER COLLECTION) is an array containing 1+ JObjects. Also we can see that taxonomy names and JObject names might contain underscores.

Now the problem is, that underscores in taxonomy names are replaced by blanks while those in the JObject names are not (see: YET ANOTHER COLLECTION vs. ANOTHER_NAME). This is a big problem when using translation keys for taxonomy names like in my case. As the underscores are replaces the keys are broken, the indexer creates taxonomies other than wished and the search doesn't find them.

The solution for this issue is to not replace underscores. Why should they be replaced at all when they're allowed for all other names and titles!?

The PR extends the regular expression to preserve underscores in taxonomy names.

associated tracker item

avatar itbra itbra - open - 9 Jul 2014
avatar Bakual Bakual - change - 7 Aug 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-08-07 19:37:16
avatar Bakual Bakual - change - 7 Aug 2014
Title
Fix addTaxonomy and getTaxonomy
[#33930] Fix addTaxonomy and getTaxonomy
avatar Bakual Bakual - close - 7 Aug 2014
avatar Bakual Bakual - close - 7 Aug 2014
avatar itbra itbra - change - 7 Aug 2014
Title
Fix addTaxonomy and getTaxonomy
[#33930] Fix addTaxonomy and getTaxonomy
avatar Sophist-UK Sophist-UK - reference | 2452b81 - 7 Oct 14

Add a Comment

Login with GitHub to post a comment