Skip to content

Conversation

@iMattPro
Copy link
Member

@iMattPro iMattPro commented Dec 26, 2025

Fixes #416

This is not possible for me test in any capacity locally. So I had to really on help from Claude on this one.

Summary of Fixes

  1. get_document_url() method (lines 526-575) - Defense in depth
  • Added validation to ensure $params is a valid non-empty array
  • Added explicit checks for all required parameters based on route type
  • Returns empty string if any required parameter is missing
  • This prevents the routing errors at the template level
  1. get_posts() method (lines 667-704) - Fixes support topic error
  • Added validation to check if unserialized $url_params is a valid non-empty array
  • Only adds documents to results if URL parameters are valid
  • The existing post_url field already contains contrib_type and contrib from the database
  • Prevents invalid posts from being added to search results
  1. get_contribs() method (lines 714-748) - Prevents contrib route errors
  • Added validation to check if contrib_type_obj exists before accessing its properties
  • Only adds documents if contrib type is valid
  • Prevents invalid contribs from being added to search results
  1. get_faqs() method (lines 758-794) - Fixes FAQ item error
  • Added validation to check if contrib_type_obj exists before accessing its properties
  • Only adds documents if contrib type is valid
  • Prevents invalid FAQs from being added to search results

These fixes work in layers:

  • First layer: The get_*() methods filter out any documents with invalid or missing parameters
  • Second layer: The get_document_url() method validates all required parameters are present before attempting to generate a route

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.

Searching Contribution Discussion Topics Broken

1 participant