From dd443d088e75563db1abd1029610bb9fcd32faec Mon Sep 17 00:00:00 2001 From: esteele Date: Sat, 19 Sep 2015 15:04:36 +0200 Subject: [PATCH] Pull default_charset from registry. --- CHANGES.rst | 4 ++-- plone/app/vocabularies/catalog.py | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index e6506cd..188b75b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,8 +4,8 @@ Changelog 2.1.22 (unreleased) ------------------- -- Nothing changed yet. - +- Pull default_charset value from the configuration registry. + [esteele] 2.1.21 (2015-09-07) ------------------- diff --git a/plone/app/vocabularies/catalog.py b/plone/app/vocabularies/catalog.py index 42b9c0e..5411c30 100644 --- a/plone/app/vocabularies/catalog.py +++ b/plone/app/vocabularies/catalog.py @@ -3,12 +3,14 @@ from plone.app.querystring import queryparser from plone.app.vocabularies import SlicableVocabulary from plone.app.vocabularies.terms import BrowsableTerm +from plone.registry.interfaces import IRegistry from plone.uuid.interfaces import IUUID from Products.CMFCore.utils import getToolByName from Products.CMFPlone.utils import safe_unicode from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from Products.ZCTextIndex.ParseTree import ParseError from zope.browser.interfaces import ITerms +from zope.component import getUtility from zope.formlib.interfaces import ISourceQueryView from zope.interface import implementer from zope.interface import provider @@ -149,11 +151,8 @@ def __init__(self, context, base_query={}, default_query=None): self.catalog = getToolByName(context, "portal_catalog") self.portal_tool = getToolByName(context, "portal_url") self.portal_path = self.portal_tool.getPortalPath() - try: - self.encoding = getToolByName( - context, "portal_properties").site_properties.default_charset - except AttributeError: - self.encoding = 'ascii' + registry = getUtility(IRegistry) + self.encoding = registry.get('plone.default_charset', 'ascii') def __contains__(self, value): """Return whether the value is available in this source