Skip to content

fix: replace deprecated h.truncate() with Jinja truncate filter#145

Open
mihajlo-kuzmanoski wants to merge 2 commits into
mainfrom
fix/replace-deprecated-truncate-helper
Open

fix: replace deprecated h.truncate() with Jinja truncate filter#145
mihajlo-kuzmanoski wants to merge 2 commits into
mainfrom
fix/replace-deprecated-truncate-helper

Conversation

@mihajlo-kuzmanoski

Copy link
Copy Markdown
Contributor

Summary

  • Replaces h.truncate() calls with the built-in Jinja truncate filter in facet_list.html and package_item.html
  • h.truncate() was deprecated in CKAN 2.10.0 and generates a warning log on every call
  • On the /dataset/ page, this was firing ~30+ warnings per request (once per facet item + once per package card), causing significant log volume and contributing to high CPU on montreal-prod

Changes

  • facet_list.html: h.truncate(label, 22)label | truncate(22, killwords=True, end='...')
  • package_item.html: h.truncate(title, truncate_title)title | truncate(truncate_title, killwords=True, end='...')

Test plan

  • Verify /dataset/ page renders correctly with no visual truncation differences
  • Confirm deprecation warnings are gone from logs after deploy

- layout4.html: fetch groups, orgs, showcases once and pass to snippets
- all_groups.html / all_organizations.html: accept passed data, fallback to fetch
- helpers.py: disable include_dataset_count (expensive SOLR count, unused on homepage)
- package_item.html: remove urlize filter from markdown-extracted notes
- remove dead related/ snippet templates (CKAN removed related object years ago)
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