Dataprocessors with required contact id filters throws "One of parameters (value: ) is not of the type Int" error for anonymous users
Creating a dataprocessor api output with contact id as a required filter and defaulted to logged in contact id, throws exception when a non logged in user uses it. Steps to reproduce ------------------- On WordPress 1. Create a dataprocessor using the attached file [test_contact_id.json](/uploads/3bb88712bf41f0b8c4ec0e85d09eb795/test_contact_id.json) 2. Install Content Views and Content Views CiviCRM 2. Create a Content View that uses this dataprocessor 3. Access the page as an anonymous user Fix --- Use 0 if no logged in contact found `CRM_Core_Session::getLoggedInContactID() ?? 0` I will add an MR that changes this line in following 2 files * Civi\DataProcessor\FilterHandler\ContactFilter * Civi\DataProcessor\FilterHandler\CaseRoleFilter Comments -------- I understand that this is not an issue in dataprocessor itself but rather the systems using dataprocessor. But I think it's better to return 0 results instead of throwing an error to make it easier. Could be related to #82 If you think it should be left as is, please close this.
issue