From 3bb2c43914f3c67fd7534842df2273918c8f0198 Mon Sep 17 00:00:00 2001 From: jackahl Date: Wed, 4 May 2022 16:25:05 +0200 Subject: [PATCH 1/3] include token in vocabulary terms --- plone/app/querystring/registryreader.py | 6 +++--- plone/app/querystring/tests/testRegistryReader.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plone/app/querystring/registryreader.py b/plone/app/querystring/registryreader.py index fa5a783..49c93b4 100644 --- a/plone/app/querystring/registryreader.py +++ b/plone/app/querystring/registryreader.py @@ -93,13 +93,13 @@ def getVocabularyValues(self, values): title = translate(item.title, context=self.request) else: title = item.title - translated.append((title, item.value)) + translated.append((title, item.value, item.token)) translated = sorted( translated, key=lambda x: normalizeString(safe_unicode(x[0])) ) - for (title, value) in translated: - field['values'][value] = {'title': title} + for (title, value, token) in translated: + field['values'][value] = {'title': title, 'token': token} return values diff --git a/plone/app/querystring/tests/testRegistryReader.py b/plone/app/querystring/tests/testRegistryReader.py index 4f8ea15..d041da5 100644 --- a/plone/app/querystring/tests/testRegistryReader.py +++ b/plone/app/querystring/tests/testRegistryReader.py @@ -77,7 +77,7 @@ def test_get_vocabularies(self): result = reader.getVocabularyValues(result) vocabulary_result = result.get( 'plone.app.querystring.field.reviewState.values') - self.assertEqual(vocabulary_result, {'foo': {'title': u'bar'}}) + self.assertEqual(vocabulary_result, {'foo': {'title': u'bar', 'token': 'foo'}}) def test_map_operations_clean(self): """tests if mapOperations is getting all operators correctly""" From 9c604ffd154929e539f33a6e62d8b1c8422cb203 Mon Sep 17 00:00:00 2001 From: jackahl Date: Wed, 4 May 2022 16:26:09 +0200 Subject: [PATCH 2/3] update changelog --- news/106.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/106.feature diff --git a/news/106.feature b/news/106.feature new file mode 100644 index 0000000..20de572 --- /dev/null +++ b/news/106.feature @@ -0,0 +1 @@ +- include vocabulary term token in termlist used to configure the querystring search [jackahl] (#106) From 12ad333805081de59b175c89c162fadc66c8e3aa Mon Sep 17 00:00:00 2001 From: jackahl Date: Wed, 4 May 2022 17:00:14 +0200 Subject: [PATCH 3/3] fix changelog entry --- news/106.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/106.feature b/news/106.feature index 20de572..6362e80 100644 --- a/news/106.feature +++ b/news/106.feature @@ -1 +1 @@ -- include vocabulary term token in termlist used to configure the querystring search [jackahl] (#106) +include vocabulary term token in termlist used to configure the querystring search [jackahl] (#106)