Communication paths not showing in selection dialogs on vote page

Problem

When voting on a proposition (e.g., /propositions/2701/vote), users can cite "Reasons for Voting" which includes "CREATE NEW COMMUNICATION PATH" or "SELECT EXISTING COMMUNICATION PATH". When trying to select a source to view available communication paths, no paths ever appear in the list.

Root Cause

In R__011_api_v1.sql, the function api_v1.get_communication_paths_by_source calls a function that doesn't exist:

SELECT public.get_source_comm_paths_sorted(source_id, kinds)

This function is never defined anywhere in the codebase, causing the API to fail silently and return no results.

Secondary Issue

In create-communication-path-dialog.tsx (lines 245-246), the ADD BASE filter logic appears inverted - it requires paths to be ALREADY linked to the proposition rather than excluding them.

Solution

  1. Create the missing get_source_comm_paths_sorted database function
  2. Fix the client-side filter logic in the dialog