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

getVocabulary: Call scrub_html on the end result #287

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/287.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
getVocabulary: Speed improvement for large vocabularies
10 changes: 5 additions & 5 deletions plone/app/content/browser/vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,18 +261,18 @@ def __call__(self):
else:
items = [
{
"id": unescape(transform.scrub_html(item.value)),
"text": (
unescape(transform.scrub_html(item.title)) if item.title else ""
),
"id": item.value,
"text": (item.title if item.title else ""),
}
for item in results
]

if total == 0:
total = len(items)

return json_dumps({"results": items, "total": total})
return unescape(
transform.scrub_html(json_dumps({"results": items, "total": total}))
)

def parsed_query(
self,
Expand Down