# Question
Title: getFieldValue failed upon organizing a case
When clicking on "manage case" in the case tab of any contact, I get the error message "getFieldValue failed". I can use all other parts of CiviCase, but don't see a possibility to set the case status, assign case coordinators or such.

This is a rather fresh Wordpress-CiviCRM 5.26.2. The organize case - functionality was never tested on this install. It might have been broken on install already, or might have come in place through settings during setup.

I couldn't find out which FieldValue throws the error. Any hints where to look or even plain solutions? The Log Entry doesn't mention CiviCase at all, rather points at Core.

Log Entry:

```
[debug] $backTrace = #0 /var/www/wordpress_solocal_energy/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(419): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/wordpress_solocal_energy/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(CRM_Core_Exception))
#2 /var/www/wordpress_solocal_energy/wp-content/plugins/civicrm/civicrm.php(1535): CRM_Core_Invoke::invoke((Array:4))
#3 /var/www/wordpress_solocal_energy/wp-includes/class-wp-hook.php(287): CiviCRM_For_WordPress->invoke("")
#4 /var/www/wordpress_solocal_energy/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters("", (Array:1))
#5 /var/www/wordpress_solocal_energy/wp-includes/plugin.php(478): WP_Hook->do_action((Array:1))
#6 /var/www/wordpress_solocal_energy/wp-admin/admin.php(254): do_action("toplevel_page_CiviCRM")
#7 {main}

```

The error message via mail reads (just the beginning of the message):

```

***ERROR***
message:            getFieldValue failed
code:
exception:          CRM_Core_Exception Object
(
    [errorData:CRM_Core_Exception:private] => Array
        (
            [error_code] => 0
        )

    [cause:protected] =>
    [_trace:PEAR_Exception:private] =>
    [message:protected] => getFieldValue failed
    [string:Exception:private] =>
    [code:protected] => 0
    [file:protected] => /var/www/wordpress_solocal_energy/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php
    [line:protected] => 1252
    [trace:Exception:private] => Array

```

DAO.php line 1252 (throw new...) is preceded by a comment in the code:

```
      public static function getFieldValue($daoName, $searchValue, $returnColumn = 'name', $searchColumn = 'id', $force = FALSE) {
    if (
      empty($searchValue) ||
      trim(strtolower($searchValue)) == 'null'
    ) {
      // adding this here since developers forget to check for an id
      // or for the 'null' (which is a bad DAO kludge)
      // and hence we get the first value in the db
      throw new CRM_Core_Exception('getFieldValue failed');
    }

```

full Log Entry (I had to delete the last 2,500 characters due to the maximum post length of 30,000 characters):

```
 [error]
$Fatal Error Details = array(3) {
  ["message"]=>
  string(20) "getFieldValue failed"
  ["code"]=>
  NULL
  ["exception"]=>
  object(CRM_Core_Exception)#15747 (10) {
    ["errorData":"CRM_Core_Exception":private]=>
    array(1) {
      ["error_code"]=>
      int(0)
    }
    ["cause":protected]=>
    NULL
    ["_trace":"PEAR_Exception":private]=>
    NULL
    ["message":protected]=>
    string(20) "getFieldValue failed"
    ["string":"Exception":private]=>
    string(0) ""
    ["code":protected]=>
    int(0)
    ["file":protected]=>
    string(85) "/var/www/wordpress_solocal_energy/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php"
    ["line":protected]=>
    int(1252)
    ["trace":"Exception":private]=>
    array(14) {
      [0]=>
      array(6) {
        ["file"]=>
        string(103) "/var/www/wordpress_solocal_energy/wp-content/plugins/civicrm/civicrm/CRM/Activity/Selector/Activity.php"
        ["line"]=>
        int(133)
        ["function"]=>
        string(13) "getFieldValue"
        ["class"]=>
        string(12) "CRM_Core_DAO"
        ["type"]=>
        string(2) "::"
        ["args"]=>
        array(4) {
          [0]=>
          string(32) "CRM_Event_BAO_ParticipantPayment"
          [1]=>
          NULL
          [2]=>
          string(14) "participant_id"
          [3]=>
          string(15) "contribution_id"
        }
      }
      [1]=>
      array(6) {
        ["file"]=>
        string(103) "/var/www/wordpress_solocal_energy/wp-content/plugins/civicrm/civicrm/CRM/Activity/Selector/Activity.php"
        ["line"]=>
        int(425)
        ["function"]=>
        string(11) "actionLinks"
        ["class"]=>
        string(30) "CRM_Activity_Selector_Activity"
        ["type"]=>
        string(2) "::"
        ["args"]=>
        array(5) {
          [0]=>
          string(2) "46"
          [1]=>
          NULL
          [2]=>
          bool(false)
          [3]=>
          string(3) "126"
          [4]=>
          NULL
        }
      }
      [2]=>
      array(6) {
        ["file"]=>
        string(101) "/var/www/wordpress_solocal_energy/wp-content/plugins/civicrm/civicrm/CRM/Core/Selector/Controller.php"
        ["line"]=>
        int(404)
        ["function"]=>
        string(7) "getRows"
        ["class"]=>
        string(30) "CRM_Activity_Selector_Activity"
        ["type"]=>
        string(2) "->"
        ["args"]=>
        array(6) {
          [0]=>
          int(4)
          [1]=>
          int(0)
          [2]=>
          int(50)
          [3]=>
          object(CRM_Utils_Sort)#15794 (7) {
            ["_name":protected]=>
            NULL
            ["_vars"]=>
            array(5) {
              [2]=>
              array(3) {
                ["name"]=>
                string(13) "activity_type"
                ["direction"]=>
                int(4)
                ["title"]=>
                string(3) "Typ"
              }
              [3]=>
              array(3) {
                ["name"]=>
                string(7) "subject"
                ["direction"]=>
                int(4)
                ["title"]=>
                string(14) "Thema, Betreff"
              }
              [4]=>
              array(3) {
                ["name"]=>
                string(19) "source_contact_name"
                ["direction"]=>
                int(4)
                ["title"]=>
                string(16) "Hinzugefügt von"
              }
              [5]=>
              array(3) {
                ["name"]=>
                string(18) "activity_date_time"
                ["direction"]=>
                int(4)
                ["title"]=>
                string(5) "Datum"
              }
              [6]=>
              array(3) {
                ["name"]=>
                string(9) "status_id"
                ["direction"]=>
                int(4)
                ["title"]=>
                string(6) "Status"
              }
            }
            ["_link":protected]=>
            string(245) "/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fview%2Fcase&page=CiviCRM&reset=1&id=5&cid=50&action=view&context=case&selectedChild=case&key=0c9e913e0fc67c8f00c1438c5692e3d7_6103&force=1&crmSID="
            ["_urlVar":protected]=>
            string(6) "crmSID"
            ["_currentSortID":protected]=>
            int(1)
            ["_currentSortDirection":protected]=>
            NULL
            ["_response"]=>
            array(5) {
              ["activity_type"]=>
              array(1) {
                ["link"]=>
                string(282) "Typ"
              }
              ["subject"]=>
              array(1) {
                ["link"]=>
                string(293) "Thema, Betreff"
              }
              ["source_contact_name"]=>
              array(1) {
                ["link"]=>
                string(295) "Hinzugefügt von"
              }
              ["activity_date_time"]=>
              array(1) {
                ["link"]=>
                string(284) "Datum"
              }
              ["status_id"]=>
              array(1) {
                ["link"]=>
                string(285) "Status"
              }
            }
          }
          [4]=>
          int(1)
          [5]=>
          int(5)
        }
      }
      [3]=>
      array(6) {
        ["file"]=>
        string(101) "/var/www/wordpress_solocal_energy/wp-content/plugins/civicrm/civicrm/CRM/Core/Selector/Controller.php"
        ["line"]=>
        int(326)
        ["function"]=>
        string(7) "getRows"
        ["class"]=>
        string(28) "CRM_Core_Selector_Controller"
        ["type"]=>
        string(2) "->"
        ["args"]=>
        array(1) {
          [0]=>
          object(CRM_Core_Selector_Controller)#15563 (18) {
            ["_object":protected]=>
            object(CRM_Activity_Selector_Activity)#15778 (8) {
              ["_contactId":protected]=>
              int(50)
              ["_admin":protected]=>
              bool(false)
              ["_context":protected]=>
              string(4) "case"
              ["_activityTypeIDs":protected]=>
              NULL
              ["_viewOptions":protected]=>
              array(13) {
                ["activity"]=>
                int(1)
                ["rel"]=>
                int(1)
                ["group"]=>
                int(1)
                ["note"]=>
                int(1)
                ["tag"]=>
                int(1)
                ["log"]=>
                int(1)
                ["CiviContribute (Zuwendungen)"]=>
                int(1)
                ["CiviMember (Mitgliederverwaltung)"]=>
                int(1)
                ["CiviEvent"]=>
                int(1)
                ["CiviCase (Fallmanagement)"]=>
                int(1)
                ["CiviGrant (Bewilligungen)"]=>
                int(0)
                ["CiviPledge (Unterstützungszusagen)"]=>
                int(1)
                ["CiviMail"]=>
                int(1)
              }
              ["_order":protected]=>
              &array(5) {
                [2]=>
                &array(3) {
                  ["name"]=>
                  string(3) "Typ"
                  ["sort"]=>
                  string(13) "activity_type"
                  ["direction"]=>
                  int(4)
                }
                [3]=>
                &array(3) {
                  ["name"]=>
                  string(14) "Thema, Betreff"
                  ["sort"]=>
                  string(7) "subject"
                  ["direction"]=>
                  int(4)
                }
                [4]=>
                &array(3) {
                  ["name"]=>
                  string(16) "Hinzugefügt von"
                  ["sort"]=>
                  string(19) "source_contact_name"
                  ["direction"]=>
                  int(4)
                }
                [5]=>
                &array(3) {
                  ["name"]=>
                  string(5) "Datum"
                  ["sort"]=>
                  string(18) "activity_date_time"
                  ["direction"]=>
                  int(4)
                }
                [6]=>
                &array(3) {
                  ["name"]=>
                  string(6) "Status"
                  ["sort"]=>
                  string(9) "status_id"
                  ["direction"]=>
                  int(4)
                }
              }
              ["_permission":protected]=>
              NULL
              ["_key":protected]=>
              NULL
            }
            ["_sort":protected]=>
            object(CRM_Utils_Sort)#15794 (7) {
              ["_name":protected]=>
              NULL
              ["_vars"]=>
              array(5) {
                [2]=>
                array(3) {
                  ["name"]=>
                  string(13) "activity_type"
                  ["direction"]=>
                  int(4)
                  ["title"]=>
                  string(3) "Typ"
                }
                [3]=>
                array(3) {
                  ["name"]=>
                  string(7) "subject"
                  ["direction"]=>
                  int(4)
                  ["title"]=>
                  string(14) "Thema, Betreff"
                }
                [4]=>
                array(3) {
                  ["name"]=>
                  string(19) "source_contact_name"
                  ["direction"]=>
                  int(4)
                  ["title"]=>
                  string(16) "Hinzugefügt von"
                }
                [5]=>
                array(3) {
                  ["name"]=>
                  string(18) "activity_date_time"
                  ["direction"]=>
                  int(4)
                  ["title"]=>
                  string(5) "Datum"
                }
                [6]=>
                array(3) {
                  ["name"]=>
                  string(9) "status_id"
                  ["direction"]=>
                  int(4)
                  ["title"]=>
                  string(6) "Status"
                }
              }
              ["_link":protected]=>
              string(245) "/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fview%2Fcase&page=CiviCRM&reset=1&id=5&cid=50&action=view&context=case&selectedChild=case&key=0c9e913e0fc67c8f00c1438c5692e3d7_6103&force=1&crmSID="
              ["_urlVar":protected]=>
              string(6) "crmSID"
              ["_currentSortID":protected]=>
              int(1)
              ["_currentSortDirection":protected]=>
              NULL
              ["_response"]=>
              array(5) {
                ["activity_type"]=>
                array(1) {
                  ["link"]=>
                  string(282) "Typ"
                }
                ["subject"]=>
                array(1) {
                  ["link"]=>
                  string(293) "Thema, Betreff"
                }
                ["source_contact_name"]=>
                array(1) {
                  ["link"]=>
                  string(295) "Hinzugefügt von"
                }
                ["activity_date_time"]=>
                array(1) {
                  ["link"]=>
                  string(284) "Datum"
                }
                ["status_id"]=>
                array(1) {
                  ["link"]=>
                  string(285) "Status"
                }
              }
            }
            ["_sortID":protected]=>
            NULL
            ["_sortOrder":protected]=>
            &array(5) {
              [2]=>
              &array(3) {
                ["name"]=>
                string(3) "Typ"
                ["sort"]=>
                string(13) "activity_type"
                ["direction"]=>
                int(4)
              }
              [3]=>
              &array(3) {
                ["name"]=>
                string(14) "Thema, Betreff"
                ["sort"]=>
                string(7) "subject"
                ["direction"]=>
                int(4)
              }
              [4]=>
              &array(3) {
                ["name"]=>
                string(16) "Hinzugefügt von"
                ["sort"]=>
                string(19) "source_contact_name"
                ["direction"]=>
                int(4)
              }
              [5]=>
              &array(3) {
                ["name"]=>
                string(5) "Datum"
                ["sort"]=>
                string(18) "activity_date_time"
                ["direction"]=>
                int(4)
              }
              [6]=>
              &array(3) {
                ["name"]=>
                string(6) "Status"
                ["sort"]=>
                string(9) "status_id"
                ["direction"]=>
                int(4)
              }
            }
            ["_pager":protected]=>
            object(CRM_Utils_Pager)#15774 (64) {
              ["_response"]=>
              array(13) {
                ["first"]=>
                string(0) ""
                ["back"]=>
                string(0) ""
                ["next"]=>
                string(0) ""
                ["last"]=>
                string(0) ""
                ["currentPage"]=>
                int(1)
                ["numPages"]=>
                int(1)
                ["csvString"]=>
                NULL
                ["status"]=>
                string(26) "Aktivitäten 1 - 24 von 24"
                ["buttonTop"]=>
                string(14) "PagerTopButton"
                ["buttonBottom"]=>
                string(17) "PagerBottomButton"
                ["currentLocation"]=>
                string(194) "/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fview%2Fcase&page=CiviCRM&id=5&cid=50&action=view&context=case&selectedChild=case&key=0c9e913e0fc67c8f00c1438c5692e3d7_6103&force=1&crmPID=1"
                ["titleTop"]=>
                string(80) "Seite  von 1"
                ["titleBottom"]=>
                string(82) "Seite  von 1"
              }
              ["_totalItems"]=>
              int(24)
              ["_perPage"]=>
              int(50)
              ["_delta"]=>
              int(1)
              ["_currentPage"]=>
              int(1)
              ["_totalPages"]=>
              float(1)
              ["_linkClass"]=>
              string(0) ""
              ["_classString"]=>
              string(0) ""
              ["_path"]=>
              string(9) "/wp-admin"
              ["_fileName"]=>
              string(9) "admin.php"
              ["_fixFileName"]=>
              bool(true)
              ["_append"]=>
              bool(true)
              ["_httpMethod"]=>
              string(3) "GET"
              ["_formID"]=>
              string(0) ""
              ["_importQuery"]=>
              bool(true)
              ["_urlVar"]=>
              string(6) "crmPID"
              ["_linkData"]=>
              array(10) {
                ["page"]=>
                string(7) "CiviCRM"
                ["q"]=>
                string(25) "civicrm/contact/view/case"
                ["id"]=>
                string(1) "5"
                ["cid"]=>
                string(2) "50"
                ["action"]=>
                string(4) "view"
                ["context"]=>
                string(4) "case"
                ["selectedChild"]=>
                string(4) "case"
                ["key"]=>
                string(37) "0c9e913e0fc67c8f00c1438c5692e3d7_6103"
                ["noheader"]=>
                bool(true)
                ["force"]=>
                string(1) "1"
              }
              ["_extraVars"]=>
              array(1) {
                ["force"]=>
                string(1) "1"
              }
              ["_excludeVars"]=>
              array(3) {
                [0]=>
                string(5) "reset"
                [1]=>
                string(7) "snippet"
                [2]=>
                string(7) "section"
              }
              ["_expanded"]=>
              bool(true)
              ["_accesskey"]=>
              bool(false)
              ["_attributes"]=>
              string(0) ""
              ["_onclick"]=>
              string(0) ""
              ["_altFirst"]=>
              string(10) "first page"
              ["_altPrev"]=>
              string(13) "previous page"
              ["_altNext"]=>
              string(9) "next page"
              ["_altLast"]=>
              string(9) "last page"
              ["_altPage"]=>
              string(7) "page %d"
              ["_prevImg"]=>
              string(17) "  < Vorheriger"
              ["_prevImgEmpty"]=>
              NULL
              ["_nextImg"]=>
              string(15) "Nächster > "
              ["_nextImgEmpty"]=>
              NULL
              ["_separator"]=>
              string(0) ""
              ["_spacesBeforeSeparator"]=>
              int(1)
              ["_spacesAfterSeparator"]=>
              int(1)
              ["_curPageLinkClassName"]=>
              string(0) ""
              ["_curPageSpanPre"]=>
              string(3) ""
              ["_curPageSpanPost"]=>
              string(4) ""
              ["_firstPagePre"]=>
              string(0) ""
              ["_firstPageText"]=>
              string(17) "  << Erster"
              ["_firstPagePost"]=>
              string(0) ""
              ["_lastPagePre"]=>
              string(0) ""
              ["_lastPageText"]=>
              string(18) "Letzter >>  "
              ["_lastPagePost"]=>
              string(0) ""
              ["_spacesBefore"]=>
              string(6) " "
              ["_spacesAfter"]=>
              string(6) " "
              ["_firstLinkTitle"]=>
              string(10) "first page"
              ["_nextLinkTitle"]=>
              string(9) "next page"
              ["_prevLinkTitle"]=>
              string(13) "previous page"
              ["_lastLinkTitle"]=>
              string(9) "last page"
              ["_showAllText"]=>
              string(0) ""
              ["_itemData"]=>
              NULL
              ["_clearIfVoid"]=>
              bool(true)
              ["_useSessions"]=>
              bool(false)
              ["_closeSession"]=>
              bool(false)
              ["_sessionVar"]=>
              string(10) "setPerPage"
              ["_pearErrorMode"]=>
              NULL
              ["links"]=>
              string(0) ""
              ["linkTags"]=>
              string(0) ""
              ["linkTagsRaw"]=>
              array(4) {
                ["first"]=>
                array(0) {
                }
                ["prev"]=>
                array(0) {
                }
                ["next"]=>
                array(0) {
                }
                ["last"]=>
                array(0) {
                }
              }
              ["range"]=>
              array(0) {
              }
              ["_allowed_options"]=>
              array(51) {
                [0]=>
                string(10) "totalItems"
                [1]=>
                string(7) "perPage"
                [2]=>
                string(5) "delta"
                [3]=>
                string(9) "linkClass"
                [4]=>
                string(4) "path"
                [5]=>
                string(8) "fileName"
                [6]=>
                string(11) "fixFileName"
                [7]=>
                string(6) "append"
                [8]=>
                string(10) "httpMethod"
                [9]=>
                string(6) "formID"
                [10]=>
                string(11) "importQuery"
                [11]=>
                string(6) "urlVar"
                [12]=>
                string(8) "altFirst"
                [13]=>
                string(7) "altPrev"
                [14]=>
                string(7) "altNext"
                [15]=>
                string(7) "altLast"
                [16]=>
                string(7) "altPage"
                [17]=>
                string(7) "prevImg"
                [18]=>
                string(12) "prevImgEmpty"
                [19]=>
                string(7) "nextImg"
                [20]=>
                string(12) "nextImgEmpty"
                [21]=>
                string(8) "expanded"
                [22]=>
                string(9) "accesskey"
                [23]=>
                string(10) "attributes"
                [24]=>
                string(7) "onclick"
                [25]=>
                string(9) "separator"
                [26]=>
                string(21) "spacesBeforeSeparator"
                [27]=>
                string(20) "spacesAfterSeparator"
                [28]=>
                string(20) "curPageLinkClassName"
                [29]=>
                string(14) "curPageSpanPre"
                [30]=>
                string(15) "curPageSpanPost"
                [31]=>
                string(12) "firstPagePre"
                [32]=>
                string(13) "firstPageText"
                [33]=>
                string(13) "firstPagePost"
                [34]=>
                string(11) "lastPagePre"
                [35]=>
                string(12) "lastPageText"
                [36]=>
                string(12) "lastPagePost"
                [37]=>
                string(14) "firstLinkTitle"
                [38]=>
                string(13) "nextLinkTitle"
                [39]=>
                string(13) "prevLinkTitle"
                [40]=>
                string(13) "lastLinkTitle"
                [41]=>
                string(11) "showAllText"
                [42]=>
                string(8) "itemData"
                [43]=>
                string(11) "clearIfVoid"
                [44]=>
                string(11) "useSessions"
                [45]=>
                string(12) "closeSession"
                [46]=>
                string(10) "sessionVar"
                [47]=>
                string(13) "pearErrorMode"
                [48]=>
                string(9) "extraVars"
                [49]=>
                string(11) "excludeVars"
                [50]=>
                string(11) "currentPage"
              }
              ["_url"]=>
              string(19) "/wp-admin/admin.php"
              ["_pageData"]=>
              array(0) {
              }
            }
            ["_pageID":protected]=>
            int(1)
            ["_pagerOffset":protected]=>
            int(0)
            ["_pagerRowCount":protected]=>
            int(50)
            ["_total":protected]=>
            int(24)
            ["_action":protected]=>
            int(4)
            ["_content":protected]=>
            NULL
            ["_embedded":protected]=>
            bool(true)
            ["_print":protected]=>
            bool(false)
            ["_store":protected]=>
            object(CRM_Case_Page_Tab)#15483 (13) {
              ["_permission"]=>
              NULL
              ["_contactId"]=>
              int(50)
              ["_name":protected]=>
              string(17) "CRM_Case_Page_Tab"
              ["_title":protected]=>
              string(4) "Fall"
              ["_mode":protected]=>
              string(4) "null"
              ["_embedded":protected]=>
              bool(false)
              ["_print":protected]=>
              bool(false)
              ["ajaxResponse"]=>
              array(0) {
              }
              ["urlPath"]=>
              array(4) {
                [0]=>
                string(7) "civicrm"
                [1]=>
                string(7) "contact"
                [2]=>
                string(4) "view"
                [3]=>
                string(4) "case"
              }
              ["useLivePageJS"]=>
              NULL
              ["_action"]=>
              int(4)
              ["_id"]=>
              int(5)
              ["_context"]=>
              string(4) "case"
            }
            ["_output":protected]=>
            int(1)
            ["_prefix":protected]=>
            NULL
            ["_dynamicAction":protected]=>
            bool(false)
            ["_case"]=>
            int(5)
          }
        }
      }
      [4]=>
      array(6) {
        ["file"]=>
        string(90) "/var/www/wordpress_solocal_energy/wp-content/plugins/civicrm/civicrm/CRM/Case/Page/Tab.php"
        ["line"]=>
        int(111)
        ["function"]=>
        string(3) "run"
        ["class"]=>
        string(28) "CRM_Core_Selector_Controller"
        ["type"]=>
        string(2) "->"
        ["args"]=>
        array(0) {
        }
      }
      [5]=>
      array(6) {
        ["file"]=>
        string(90) "/var/www/wordpress_solocal_energy/wp-content/plugins/civicrm/civicrm/CRM/Case/Page/Tab.php"
        ["line"]=>
        int(180)
        ["function"]=>
        string(4) "view"
        ["class"]=>
        string(17) "CRM_Case_Page_Tab"
        ["type"]=>
        string(2) "->"
        ["args"]=>
        array(0) {
        }
      }
      [6]=>
      array(6) {
        ["file"]=>
        string(88) "/var/www/wordpress_solocal_energy/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php"
        ["line"]=>
        int(312)
        ["function"]=>
        string(3) "run"
        ["class"]=>
        string(17) "CRM_Case_Page_Tab"
        ["type"]=>
        string(2) "->"
        ["args"]=>
        array(2) {
          [0]=>
          array(4) {
            [0]=>
            string(7) "civicrm"
            [1]=>
            string(7) "contact"
            [2]=>
            string(4) "view"
            [3]=>
            string(4) "case"
          }
          [1]=>
          NULL
        }
      }

```

# Answer
From your backtrace it looks like, you have a activity of type payment or refund that is suppose to have link to contribution in civicrm\_activity.source\_record\_id which is unfortunately set as NULL.
> 1 votes

# Answer
A solution for not having a `civicrm_activity.source_record_id` tied to the contribution is to create a new activity type of e.g. "Legacy Payment" and switch those activity type ID's. Encountered this on a DB migration.

> Source Record ID: Artificial FK to original transaction (e.g. contribution) IF it is not an Activity.
> 0 votes

---
Tags: wordpress, error, civicase, core
---


title: want to get more details about CiviHR

text:
# Question
Title: want to get more details about CiviHR
we plan to make use of CiviCRM to capture the vacation and leave of staff, can we do that or someone has tried this? I heard there is CiviHR available, can someone tell us where we can get more details about this? Thanks

# Answer
> 1 votes
So far as I know, CiviHR was abandoned. See What is the actual status of CiviHR

It used to have a website at civihr.org but that timed out when I tried it just now.

---
Tags: civihr
---


title: Can I add fonts to dompdf in CiviCRM?

text:
# Question
Title: Can I add fonts to dompdf in CiviCRM?
I'm trying to print pdf thank you letters in Garamond font and I am having problems figuring out how to add fonts to dompdf.

Does anyone know if this is the right approach? If so, had anyone added fonts before?

Thanks!

# Answer
> 1 votes
I know this is an old question but in case anyone else is looking for the answer to this please look at the documentation here:

https://docs.civicrm.org/installation/en/latest/general/unicode\_pdf/

Also see this answer:

https://civicrm.stackexchange.com/a/27746/127

---
Tags: pdf
---


# Question
Title: membershiprenewallink can't find membershiptype
everybody Sorry if it's a newbie question, I hope you could help anyway.

My site (drupal 9 + civi + php 8.1) is actually working for anonymous users; as soon as a user login the WSoD appears (The website encountered an unexpected error). Every time I visit the page with an authenticated user the WSoP appears and this is what comes up in the PHP error log (followed by the details):

```
Error: Class "Civi\Api4\MembershipType" not found in [path-to-files]/civicrm/ext/membershiprenewallink/settings/membershiprenewallink.setting.php on line 11

```

Even if I try to disable the extension via drush or cv I get this error:

```
In membershiprenewallink.setting.php line 11: Class 'Civi\Api4\MembershipType' not found

```

I think that I have some global configuration problems, but the site was up and running nd in production. From where I could start? Many thanks for your help

# Answer
> 1 votes
It looks like you have CiviMember disabled on your site, so the Membership Renewal Link extension crashes. Enable CiviMember. If you can't log in, you can do it from the command line:

```
cv en civi_member

```

---
Tags: drupal, civimember, php
---


title: Sending MMS through CiviCRM?

text:
# Question
Title: Sending MMS through CiviCRM?
My org recently integrated Twilio with CiviCRM and while we're excited to start using something for SMS that's connected to the database, it doesn't look like we'll be able to send multimedia (MMS) pictures, etc. through the system.

I've looked through the documentation, and there is plenty of SMS but nothing that I can find on MMS or sending multimedia via the service. I did find this older ticket that discussed wanting to use the CiviSMS option to send QR codes and it noted that Twilio at the time didn't include MMS. With the updates to the Twilio platform to allow for MMS, are there ways to integrate (or update) the CiviCRM code to allow for MMS?

Related ticket on MMS through CiviCRM (~abt. 4 years old) Send QR code via SMS?

# Answer
I think there'd be some work required for this. In addition to updating the civi core forms to handle pics, the twilio integration hasn't really been updated in years, so it wouldn't support pics either at the moment.
> 3 votes

# Answer
an other option would be to use Whatsapp. I saw there's a beginning of an integration. And there's no cost per message. I'm thinking of Whatsapp as a good alternative to e-mail that people just don't read any more (not speaking for those who just don't use e-mails at all).
> 1 votes

---
Tags: sms, civisms
---


# Question
Title: Use Caldera Forms default instead of retrieved default of form processor for specific inputs
I came up with a form in Caldera Forms that has some input fields like name, address and an field with name "amount". I'd like to prefill the name and address from civiCRM -- this works. But give the "amount" field a default value specified in Caldera Forms.

When I use the functionality to retrieve defaults for the input fields from civiCRM the "amount" field is also retrieved and filled with the empty string -- as there is no default value in civiCRM (I did not set any default in the form processor "retrieval of defaults" tab in section "set defaults").

What do I overlook here? how can I make the default of Caldera Forms the one to be used? I have to map the parameter %amount% to the input field "amount" as I want to pass the amount from the form to the form processor.

How can I omit the field "amount" from being filled with "" from form processor's "retrieve defaults" functionality?

# Answer
> 0 votes
not sure to understand your question but it's possible to use different amounts like here in production: https://ffmns.gestad.net/licence/. It has a complex setting but i think that using the contribution processor in Caldera gives you access to these options.

---
Tags: caldera-forms, form-processor
---


# Question
Title: How can I decrypt a password stored in CiviCRM?
I've added a mail account at **Administer » System Settings » Outgoing Email**. I don't know the password, but I need it. How can I get ahold of it?

# Answer
First - you must have command-line access, the `cv` utility installed, and database access. This also assumes modern CiviCRM, where you have `CIVICRM_CRED_KEYS` defined in your `civicrm.settings.php`.

Check the database for the record that contains your password with the following SQL:

```
SELECT REGEXP_SUBSTR(value, 'smtpPassword.*') FROM civicrm_setting WHERE name = 'mailing_backend';

```

You should get back something like this:

```
MariaDB [my_database]> SELECT REGEXP_SUBSTR(value, 'smtpPassword.*') FROM civicrm_setting WHERE name = 'mailing_backend';
+-------------------------------------------------------------------------------------------------------------------------------+
| REGEXP_SUBSTR(value, 'smtpPassword.*')                                                                                |
+-------------------------------------------------------------------------------------------------------------------------------+
| smtpPassword";s:101:"CTK?k=dxBmEYKu9NyzrI1vngkmrxtqUL4&t=NuDgeEtjXFvxYWwAYii0S2GZqSfcpWS5G7d6DF1souXWmxixnQMwrH46tV_oqRLy";} |
+-------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)

```

The encrypted password is in quotes, starting with `CTK`. If it does NOT start with `CTK`, it's not encrypted - that's your password.

If it *is* encrypted, run the following command on your command line:

```
cv ev '$k = new \Civi\Crypto\CryptoToken(); $t = $k->decrypt("\x02" . "<encrypted password here>"); echo $t'

```

For instance, using the example above:

```
cv ev '$k = new \Civi\Crypto\CryptoToken(); $t = $k->decrypt("\x02" . "CTK?k=dxBmEYKu9NyzrI1vngkmrxtqUL4&t=89TTC7izYJ5KemXD4Pf8QckyMKvJ4RJcSQM2ejZPlx0HgUVYQguv_yJJn22QAuri"); echo $t'

```

The password will be returned on the command line. Note that you MUST be running this command using the same `CIVICRM_CRED_KEYS` setting in `civicrm.settings.php` that existed when the key was encrypted.
> 3 votes

---
Tags: civimail, passwords
---


title: Where is my custom form

text:
# Question
Title: Where is my custom form
I just created a from (through Form Builder) composed of custom data fields. Essentially this form is used to collect information about potential members that we are recruiting.

I have two questions.

First, I want to give it a try by entering some test data. Unfortunately, the form does not appear in any menu choice on CiviCRM. My question is how do I navigate to the newly created form to enter data?

Second, I want to give access to our recruiters to enter the data from a mobile phone. How do I set this up?

Thanks,

Joe

# Answer
When composing your form there are some settings for this on the left side of the screen:

You'll want to add a **Page Route** so the form has a url. You can optionally add it to the menubar by checking **Add to Navigation Menu**.

To allow others to use the form, set the **Permission** appropriately so they have access, and then email or text them a link to the form.
> 0 votes

---
Tags: forms, formbuilder, access
---


# Question
Title: tar : the -- 'f' option needs an argument
I have created a script that updates civicrm version of the instance I want. This script install with the `wget` command the choosed civicrm version from the civicrm download website. **https://download.civicrm.org/…** I use a variable to get the civicrm version and the `tar -xzf` command to extract the zipped folder.

`cms_instance = "drupal"` and `civi_type_version = "p"`

The line with the problem : **tar -xzf $civi\_download\_prod** And I got this error in the command line : **tar : the -- 'f' option needs an argument**

**Here is the script :**

```
[ $cms_instance == "drupal" ] && extension="tar.gz"
[ $civi_type_version == "p" ] && download_link="https://download.civicrm.org/civicrm-$civi_version-$cms_instance.$extension"

if wget -S --spider $download_link  2>&1 | grep 'HTTP/1.1 200 OK' > /dev/null 2>&1;
then
      echo -e '\e[93m=======================================\033[0m'
      echo "The version of CiviCRM you asked is available in the server"
      echo "Instance $cms_instance"
      echo "The actual CiviCRM version is $civi_name"
      echo -e '\e[93m=======================================\033[0m'
      wget $download_link
else
      echo -e '\e[93m=======================================\033[0m'
      echo -e '\e[93m\033[31m No CiviCRM version have been found\033[31m'
      echo -e '\e[93m=======================================\033[0m'
      exit 1
fi

civi="civicrm"
civi_download_prod="$civi-$civi_version-$cms_instance.$extension"

# clear cache civi
cv flush

[ $cms_instance == "drupal" ] && [ $civi_type_version == "p" ] && **tar -xzf $civi_download_prod** && rm -rf $civi_download_prod

```

Command line : **tar : the -- 'f' option needs an argument**

# Answer
Welcome to SE!

Although this is about downloading CiviCRM files, there is nothing specific to CiviCRM so this might get closed as off-topic. But we try to be friendly, especially to newcomers :-)

How are you calling the script? There are a few variables that need to be set.

Maybe try putting `echo "File is $civi_download_prod"` before the last line to confirm the variable is being set correctly.

A few observations on the rest of the script:

* Is this the start of a more comprehensive downloader that will also handle downloads for other CMSes? It seems unnecessarily complex for what it is actually doing.
* I'm not clear what you gain by the first `wget` since you're always downloading it if it exists. `if wget -q $download_link` would be simpler.
* You don't need `cv flush` before extracting the files.
* It would be preferable to construct the file name once, not twice.

So how about:

```
[ $cms_instance == "drupal" ] && extension="tar.gz"
[ $civi_type_version == "p" ] && download_file="civicrm-$civi_version-$cms_instance.$extension" && download_link="https://download.civicrm.org/$download_file"

if wget -q $download_link
then
      echo -e '\e[93m=======================================\033[0m'
      echo "The version of CiviCRM you asked is available in the server"
      echo "Instance $cms_instance"
      echo "The actual CiviCRM version is $civi_name"
      echo -e '\e[93m=======================================\033[0m'
else
      echo -e '\e[93m=======================================\033[0m'
      echo -e '\e[93m\033[31m No CiviCRM version have been found\033[31m'
      echo -e '\e[93m=======================================\033[0m'
      exit 1
fi

[ $cms_instance == "drupal" ] && [ $civi_type_version == "p" ] && tar -xzf $download_file && rm $download_file

```
> 1 votes

---
Tags: civicrm-home
---


# Question
Title: Discount Code Applies to ALL lines, vs. the specified line in the Price Set Field
I have set up a discount to apply 100% of the price to ***specific Price Fields*** from my Price Set, however, the discount is applied to all lines. We have tried editing the Discount to a specific amount instead of a %, and the result is the same.

Currently using CiviCRM v 5.58.1 and CiviDiscount v 3.8.8

# Answer
Looks like there is in fact a bug here. I was able to recreate it by adding a required radio price field with only one option and a second price field with multiple options. If the required field has more than one option, then the bug doesn't occur.

Please post an issue on CiviDiscount: https://lab.civicrm.org/extensions/cividiscount/-/issues/

If you're able to work on a fix, that's even better.
> 0 votes

---
Tags: civievent, price-sets, cividiscount, discounts, percentage-price-field
---


# Question
Title: Custom fields not always displaying on profile
I'm having an intermitent issue with custom fields on a profile. Sometimes they are displaying fully and correctly, sometimes not (though name and email continues to be visible). It seems if I go into the profile and change a setting (any setting for any field) it then starts to display properly again on the public profile. Does anyone know why this is happening? We are on Drupal, on CiviCRM 5.58.1.

TIA

# Answer
> 2 votes
Thanks for the replies. That "custom data" permission wasn't set (but it did work sometimes without that being tagged, for non-logged-in users, so I'm not sure if that itself was the problem?) But I've ticked that now, and I've refreshed the caches, and that made it work for administrators and anonymous users. I'll keep an eye on it to see if it continues to work. Thanks!

---
Tags: custom-fields, profile
---


# Question
Title: Fixed: Unknown geocoding error on Nominatim (Open street maps)
we use maps for CiviEvent, but now we always get this error message:

Unknown geocoding error on :Nominatim (Open street maps):The geocoder server returned an invalid response (404) for query "https://nominatim.openstreetmap.org/search/search?format=jsonv2&q=Ulmenstr.%2015%2CBad%20Saarow%2C15526%2CBrandenburg%2CDeutschland&addressdetails=1&extratags=1&limit=5&accept-language=de". We could not parse it.

We use OpenStreetMaps via Geocoder (no Google). How do I get the API-key?

Kind regards, Regina

---

CiviCRM 5.58.1. with WordPress 6.3

# Answer
> 3 votes
this is a known issue in the Geocoder extension and should be fixed in the latest version (1.10 as of today). Please note that Geocoder 1.9+ requires CiviCRM 5.60+. If you need to stay on 5.58.1, you can also use Geocoder 1.8 and manually fix the wrong url causing this error in the database. Simply change https://nominatim.openstreetmap.org/search to https://nominatim.openstreetmap.org/ in the civicrm\_geocoder table (column: url). You won't need an API key for Openstreetmap.

---
Tags: civievent, error, geocoding
---


title: DB Error: extension not found

text:
# Question
Title: DB Error: extension not found
I'm running CiviCRM 5.63.1 on a Joomla 4 environment and using PHP 8.0.28.

cli.php keeps failing with these errors:

\[code\] =\> -25 \[message\] =\> DB Error: extension not found \[mode\] =\> 16 \[debug\_info\] =\> \[DB Error: extension not found\] \[type\] =\> DB\_Error \[user\_info\] =\> \[DB Error: extension not found\] \[to\_string\] =\> \[db\_error: message="DB Error: extension not found" code=-25 mode=callback callback=CRM\_Core\_Error::simpleHandler prefix="" info=" \[DB Error: extension not found\]"\]

Looking at the logs I can see where the error gets thrown and it seems to be in PEAR.php

Aug 14 17:10:43 \[debug\] $backTrace = #0 /var/www/vhosts/xxxx.org/httpdocs/administrator/components/com\_civicrm/civicrm/CRM/Core/Error.php(249): CRM\_Core\_Error::backtrace("backTrace", TRUE) #1 /var/www/vhosts/xxxx.org/httpdocs/administrator/components/com\_civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(945): CRM\_Core\_Error::simpleHandler(Object(DB\_Error)) #2 /var/www/vhosts/xxxx.org/httpdocs/administrator/components/com\_civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR\_Error-\>\__construct("DB Error: extension not found", -25, 16, (Array:2), " \[DB Error: extension not found\]") #3 /var/www/vhosts/xxxx.org/httpdocs/administrator/components/com\_civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB\_Error-\>\__construct(-25, 16, (Array:2), " \[DB Error: extension not found\]") #4 /var/www/vhosts/xxxx.org/httpdocs/administrator/components/com\_civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR::\_raiseError(Object(DB\_mysql), NULL, -25, 16, (Array:2), " \[DB Error: extension not found\]", "DB\_Error", TRUE) #5 /var/www/vhosts/xxxx.org/httpdocs/administrator/components/com\_civicrm/civicrm/vendor/pear/db/DB/common.php(1928): PEAR-\>\__call("raiseError", (Array:7)) #6 /var/www/vhosts/xxxx.org/httpdocs/administrator/components/com\_civicrm/civicrm/vendor/pear/db/DB/mysql.php(202): DB\_common-\>raiseError(-25) #7 /var/www/vhosts/xxxx.org/httpdocs/administrator/components/com\_civicrm/civicrm/vendor/pear/db/DB.php(571): DB\_mysql-\>connect((Array:10), FALSE)

Any clues?

I found an old post where it was suggested that changing the connect string to mysqli fixed it, tried that but it didn't.

Is this an incompatibility between PHP 8 and Pear? Are there any other connection methods I can try.

Thanks

# Answer
Based on comments the problem was that mysqli was not enabled in php.
> 0 votes

---
Tags: joomla, php
---


# Question
Title: Can iATS "pause" recurring contributions?
I know that you can't pause contributions from within CiviCRM with processors that aren't token-based - but can you with iATS?

If you can't do it within CiviCRM, can it be done from within the iATS portal?

# Answer
> 3 votes
Yes and No.

Here's two options:

1. if you want to Pause for a specified period of time (say 6months) -\> hit Edit on the Recurring Contribution and advance the next scheduled contribution date by +6months.
2. if you want to pause indefinitely -\> you could hit Cancel on the Recurring Contribution. And then (later on when ready to "un-pause") -\> set the Recurring Series to In Progress again \[that can not be done via the CiviCRM UI, but using API Explorer or with direct database access it's a simple query).

No pause on the iATS side of things.

# Answer
> 0 votes
I do this regularly right in CiviCRM by editing the recurring contribution and setting the "Next Scheduled Contribution Date" to be when I want the pause to end, works great.

---
Tags: recurring-contributions, iats, iatspayments
---


title: Wordpress duplicates my contacts

text:
# Question
Title: Wordpress duplicates my contacts
I haven't quite worked out under which circumstances, but our WordPress (4.0.1) and Civi (4.5.2) seems to create duplicate contacts for the same WordPress user. I think it happens when they log in, but I can't be sure. It doesn't happen to most people, just some--including me!

I now have 5 contacts with my name. The first one has all the details associated with it including membership and activities, the others have minimal information but unfortunately they have some activities and contributions (this has been caused by other administrators picking the "wrong" contact when assigning contributions). I've logged in many more than 5 times, so not sure how this happened. Any tips on diagnosing the problem?

Related to this, if I try and merge duplicate contacts, it now loses the activities and contributions. I'm sure that in previous versions of Civi, this worked OK, but at the moment I'm having to manually move the activities and contributions using SQL. Is there a better way?

Thanks!

# Answer
> 5 votes
You should go look at your civicrm\_uf\_match table in the database. If you ever cleared out users in bulk or moved from one site to another, you probably have entries in there for users or contacts that don't exist. The purpose of the tables is to link users from your CMS (the uf\_id column) with contacts from CiviCRM (the contact\_id) column.

The (relatively) foolproof method to deal with this is the following

1. Log out from WordPress
2. Run the following query, which will empty that table:

```
DELETE FROM civicrm_uf_match;

```
3. Log in to WordPress again. This should cause CiviCRM to find (or create yet another copy of) your corresponding contact record.
4. Go to CiviCRM, and in the menu, select Administer \> Users and Permissions \> Synchronize Users to Contacts and follow the prompts.
5. It will find or create a contact for each of your WordPress users. You may find that it generates a handful of duplicates. You might run a Find and Merge Duplicate Contacts search on individuals when you're done: this may have generated more duplicates, and it sounds like you may already have a bunch of duplicates.

# Answer
> 1 votes
I have seen this problem in Drupal when a logged in administrator uses a front-end form to register a participant in an event or sign a user up for membership instead of using the backend form. Try to always use the options for New Participant or New Membership in the menu system or from the Contact Summary form. Using the sign up pages that you Manage for the public leads to problems like this.

# Answer
> 1 votes
A ticket describing this bad behavior now exists at https://lab.civicrm.org/dev/core/-/issues/4500 , which describes the technical causes of the bad behavior, mentions another set of actions that can lead to this problem, and provides an alternative workaround (manually updating the values in `civicrm_uf_match` via SQL).

Hopefully it will also serve as a focal point for moving toward a fix and/or standardized "best practices" to avoid or resolve this issue if/when it arises.

---
Tags: wordpress, duplicate-contacts
---


# Question
Title: 100s of duplicate contacts created of current user when using CiviCRM
I have recently migrated a CiviCRM instance from Joomla to Wordpress, everything went smoothly.

The installation is using CiviCRM 5.7.2 and PHP 7.2.

We're now seeing a peculiar problem where, when users are making general use of CiviCRM, literally 100s of duplicate contacts are created of whichever user is working.

The duplicates accumulate very quickly. In about 10 minutes of experimentation with CiviMail today, I managed to create 249 duplicate contacts of myself.

In testing for this question, I created 25 contacts simply by searching for 'contacts created today' in advanced search.

Just about any action appears to create these duplicates.

When deleting them, CiviCRM will warn me that 'you are currently logged in as' one of the duplicates and therefore it cannot be deleted. Obviously my user account should not be associated with a just-created contact.

My guess is that this may be caused by something like a missing database constraint, but I'm at a bit of a loss as to where to start looking.

Any ideas?

# Answer
I have seen this when the `uf_match` table does not have the proper values for WP Id (`uf_id`), Contact ID (`contact_id`) and email (`uf_name`).

I don't know why this occurs, I've not been able to track it down, but I suspect it is when the `uf_id` and `contact_id` do not have the email in use by WP.

You can user API Explorer `/wp-admin/admin.php?page=CiviCRM&q=civicrm/api` to display the records or do a query on the `civicrm_uf_match` table.

To fix, I have deleted the 'bad contacts (merging if data needs to be retained) and then updating the `uf_match` records so this does not re-occur.
> 6 votes

# Answer
A ticket describing this bad behavior now exists at https://lab.civicrm.org/dev/core/-/issues/4500 , which describes the technical causes of the bad behavior, mentions another set of actions that can lead to this problem, and provides an alternative workaround (manually updating the values in `civicrm_uf_match` via SQL).

Hopefully it will also serve as a focal point for moving toward a fix and/or standardized "best practices" to avoid or resolve this issue if/when it arises.
> 1 votes

---
Tags: wordpress, contacts, duplicate-contacts, user-account
---


# Question
Title: SearchKit: How can I do math on currencies?
I'm trying to replicate a (buggy) report in Extended Reports, basically:

| Campaign | Goal | Amount Raised | Amount Left |
| --- | --- | --- | --- |
| Capital Campaign | $10,000 | $8,000 | $2,000 |
| Another Campaign | $15,000 | $6,000 | $9,000 |

The equivalent SQL would be:

```
SELECT campaign.title as "Campaign", campaign.goal_revenue AS "Goal", SUM(contrib.total_amount) AS "Amount Raised", goal_revenue - SUM(contrib.total_amount) as "Amount Left"
FROM civicrm_campaign campaign
JOIN civicrm_contribution contrib ON campaign.id = contrib.campaign_id
GROUP BY campaign.id;

```

However, there seems to be no way to do this. SQL transformations won't work because I can't subtract the aggregated Amount Raised from Goal (or do arithmetic transforms on aggregated fields). But Smarty treats the values as strings, with no way to convert to numbers (using `intval` filter or casting to `(int)`) both generate errors.

# Answer
> 2 votes
I was finally able to use Smarty to rewrite a random field to be the "Amount Left", but it's not pretty:

```
{capture name=goal assign=goal}[goal_revenue]{/capture}
{capture name=goal2 assign=goal}{$goal|replace:"$":""|replace:",":""}{/capture}
{capture name=raised assign=raised}[SUM_Campaign_Contribution_campaign_id_01_total_amount]{/capture}
{capture name=raised2 assign=raised}{$raised|replace:"$":""|replace:",":""}{/capture}
{capture name=remaining assign=remaining}{math equation="x - y" x=$goal y=$raised}{/capture}
{$remaining|crmMoney}

```

It seems like it would be easier if any of the following were true:

* A "raw" Smarty filter were available to pass my currency as a number.
* It's possible to use Smarty filters directly on SK tokens.
* It's possible to use arithmetic SQL transformations with aggregated values.
* A field transformation "Raw" existed to disable formatting.

---
Tags: searchkit, smarty, currency
---


title: Unable to save changes to report

text:
# Question
Title: Unable to save changes to report
I copied a report and updated the filters for what I am looking for in addition to changing the title. When I select "Save" or "Save a Copy" from the dropdown menu, neither works. Not sure what has changed because I used to be able to do this in the past. Any help would be much much appreciated!

# Answer
> 1 votes
Without more info this is difficult to pin down, but I can offer several suggestions of where to look.

* Ensure you have the necessary permissions - either "Administer CiviCRM" or the relevant CiviReport permissions. They're at **Administer menu » Users and Permissions » Permissions (Access Control)**, then click "Drupal Access Control" (or WordPress/Joomla/Backdrop Access Control, whichever is appropriate). "Save Report Criteria" is the big one.
* If permissions are good, check the log for errors. I don't know if you're at all technical and/or if you have permission to install CiviCRM extensions. If you're more technical, you can view the logs on the server. If not, go to **Administer menu » System Settings » Extensions**, click the **Add New** tab, and install CiviCRM Log Viewer. After that, logs will be in **Administer menu » Administration Console » Log Viewer**.

I recommend viewing the log, noting the most recent entry's number. Then immediately replicate the issue, reload the logs, and see if you have new entries. If so, I recommend editing your question to paste in everything from the new log entries. That should give folks most or all of the info needed to give a solution.

---
Tags: civireport
---


# Question
Title: SOS- numerical field quantity in contribution export
Turning in circles here and going crazy- I created a contribution page with a price set that includes numerical fields when guests want to purchase multiple individual tickets for our upcoming gala, in addition to radio button options.

Nowhere am I able to create a contribution report that exports the total transaction amount and the value for this numerical field. For example, I want to quickly see that $1800 = 2, $900 tickets. So I will need the item price $900, quantity =2, and total = $1800.Obviously I can infer this but I want to export this quickly and frequently and be able to forward to my team without manual manipulation.

I've tried a contribution details report, find contributions, and a Civi bookkeeping transactions report with filters by my target financial type. None of these options are giving me the data I need. I thought this was a relatively simple ask...but not with Civi...I contacted our support who was also stumped and advised to use pivot charts which I'm not an export in. I also tried IF formulas in excel and I have too many criteria. I just want my simple registration data.

...can anyone point me in the right direction?...

# Answer
> 1 votes
The Extended Reports extension has a couple price set reports that should give you what you need.

Another option would be to build your own table in SearchKit.

# Answer
> 0 votes
Below is a SearchKit that I quickly threw together and exported. Install it by going to **Search menu » SearchKit**, then clicking **Import** (it's just under the **New Search** button. It shows each line item in its own row, though you could group together for one line per registration.

Lars's suggestion of Extended Reports is easier to customize to your needs, but this is more flexible. You also don't need to install an extension.

Ideally in the future events are set up as event pages, which have better support for listing tickets purchased this way, but this or Extended Reports will get you similar functionality with a Contribution Page.

```
[
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "Line_Item_Example",
          "label": "Line Item Example",
          "form_values": null,
          "mapping_id": null,
          "search_custom_id": null,
          "api_entity": "Contribution",
          "api_params": {
            "version": 4,
            "select": [
              "contact_id.display_name",
              "receive_date",
              "Contribution_LineItem_contribution_id_01.label",
              "Contribution_LineItem_contribution_id_01.qty",
              "Contribution_LineItem_contribution_id_01.unit_price",
              "Contribution_LineItem_contribution_id_01.line_total"
            ],
            "orderBy": [],
            "where": [],
            "groupBy": [],
            "join": [
              [
                "LineItem AS Contribution_LineItem_contribution_id_01",
                "INNER",
                [
                  "id",
                  "=",
                  "Contribution_LineItem_contribution_id_01.contribution_id"
                ]
              ]
            ],
            "having": []
          },
          "expires_date": null,
          "description": null
        }
      ],
      "match": [
        "name"
      ]
    }
  ]
]

```

---
Tags: contributions, reports
---


# Question
Title: From the 'find grants' report, I wish to bulk 'upgrade' all chosen but want to put in the date money transferred
I wish to put in the date money transferred in my upgrade grants. Currently only have the option to put in Grant decision. Want to add the additional line - Money transferred. How do I do this?

# Answer
> 2 votes
There are only few fields available on the update all grants actions. If a new field needs to added you can add via extension using buildform hook.

But there is an extension that does bulk update on grant. This extension uses Civi profile, this allows you to add fields in a profile to be available on bulk update screen.

# Answer
> 2 votes
Besides Pradeep's answer, SearchKit should do what you need.

* go to **Search menu » SearchKit**.
* Select **New Search**.
* In *Search for*, select **Grants**.
* Add some columns with the "Add" button so you can identify which grants you'd be editing (see screenshot, item 1).
* Press **Search** to confirm (item 2).
* Once you're satisfied you can distinguish which grants are which, add some filters in the **Where** section (item 3) and press **Search** again.
* When you're happy with your list, either a) check the boxes next to individual grants, or b) click the checkbox selector under **Search** to select all.
* Click the **Actions** button (item 4) and select **Update Grants**.

You can now choose "Money Transferred", or any other grant field, with a value to set in all selected grants.

---
Tags: grant
---


# Question
Title: "cURL error 3: URL rejected: No host part in the URL" when opening extensions page
i'm getting a cURL error which i am unable to find any solutions to after searching in this forum and on the internet. Will be eternally grateful for any advice.

My CiviCRM is powered by CiviCRM 5.49.4. on Wordpress 6.1.3

The cURL error 3 comes up when:

1. Accessing the CiviCRM plugin landing page at \[host\]/wp-admin/admin.php?page=CiviCRM, the error disappears on refresh and the landing page widgets loads normally
2. When accessing the Extensions page at \[host\]/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fextensions&reset=1 , and the error persists.

**I wonder if the extension directory is the issue:**

Extensions Directory found at \[host\]/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2Fpath reads

> \[cms.root\]/wp-content/uploads/civicrm/ext

and the directory only contains a cache folder.

While i see the extension resources appears to be stored at

> \[cms.root\]/wp-content/plugins/civicrm/civicrm/ext/

But i am unable to draw the causal relationship between the error and the empty /ext/ directory... Please enlighten me!

**Error stack trace:**

I share the stack trace below with replaced \[cms.root\]

```
    $Fatal Error Details = array:3 [
  "message" => "cURL error 3: URL rejected: No host part in the URL (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)"
  "code" => null
  "exception" => GuzzleHttp\Exception\RequestException {#19613
    -request: GuzzleHttp\Psr7\Request {#19607
      -method: "GET"
      -requestTarget: null
      -uri: GuzzleHttp\Psr7\Uri {#19603
        -scheme: ""
        -userInfo: ""
        -host: ""
        -port: null
        -path: "/single"
        -query: ""
        -fragment: ""
      }
      -headers: array:1 [
        "User-Agent" => array:1 [
          0 => "GuzzleHttp/6.5.5 curl/8.2.1 PHP/7.4.33"
        ]
      ]
      -headerNames: array:1 [
        "user-agent" => "User-Agent"
      ]
      -protocol: "1.1"
      -stream: GuzzleHttp\Psr7\Stream {#19606
        -stream: stream resource {@490
          wrapper_type: "PHP"
          stream_type: "TEMP"
          mode: "w+b"
          unread_bytes: 0
          seekable: true
          uri: "php://temp"
          options: []
        }
        -size: 0
        -seekable: true
        -readable: true
        -writable: true
        -uri: "php://temp"
        -customMetadata: []
      }
    }
    -response: null
    -handlerContext: array:41 [
      "errno" => 3
      "error" => "URL rejected: No host part in the URL"
      "appconnect_time" => 0.0
      "url" => "/single"
      "content_type" => null
      "http_code" => 0
      "header_size" => 0
      "request_size" => 0
      "filetime" => -1
      "ssl_verify_result" => 0
      "redirect_count" => 0
      "total_time" => 0.0
      "namelookup_time" => 0.0
      "connect_time" => 0.0
      "pretransfer_time" => 0.0
      "size_upload" => 0.0
      "size_download" => 0.0
      "speed_download" => 0.0
      "speed_upload" => 0.0
      "download_content_length" => -1.0
      "upload_content_length" => -1.0
      "starttransfer_time" => 0.0
      "redirect_time" => 0.0
      "redirect_url" => ""
      "primary_ip" => ""
      "certinfo" => []
      "primary_port" => 0
      "local_ip" => ""
      "local_port" => 0
      "http_version" => 0
      "protocol" => 0
      "ssl_verifyresult" => 0
      "scheme" => ""
      "appconnect_time_us" => 0
      "connect_time_us" => 0
      "namelookup_time_us" => 0
      "pretransfer_time_us" => 0
      "redirect_time_us" => 0
      "starttransfer_time_us" => 0
      "total_time_us" => 0
      "curl_version" => "8.2.1"
    ]
    #message: "cURL error 3: URL rejected: No host part in the URL (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)"
    #code: 0
    #file: "[cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php"
    #line: 201
    trace: {
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:155 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:105 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:43 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:28 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:51 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php:37 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Middleware.php:29 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php:70 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Middleware.php:59 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/HandlerStack.php:71 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Client.php:351 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Client.php:162 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Client.php:182 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php:253 {
        › $client = $this->getGuzzleClient();
        › $response = $client->request('GET', $url, ['sink' => $filename, 'timeout' => \Civi::settings()->get('http_timeout')]);
        › restore_error_handler();
        arguments: {
          $method: "GET"
          $uri: "/single"
          $options: array:3 [ …3]
        }
      }
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php:196 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php:151 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component/Env.php:588 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component.php:76 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php:236 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php:202 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php:93 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Core/Page.php:248 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Event/Page/EventInfo.php:338 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:319 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
      [cms.root]/wp-content/plugins/civicrm/civicrm.php:1199 { …}
      [cms.root]/wp-content/plugins/civicrm/includes/civicrm.basepage.php:380 { …}
      [cms.root]/wp-includes/class-wp-hook.php:308 { …}
      [cms.root]/wp-includes/class-wp-hook.php:332 { …}
      [cms.root]/wp-includes/plugin.php:565 { …}
      [cms.root]/wp-includes/class-wp.php:797 { …}
      [cms.root]/wp-includes/functions.php:1332 { …}
      [cms.root]/wp-blog-header.php:16 { …}
      [cms.root]/index.php:17 { …}
    }
  }
]

Aug 06 17:03:25  [debug] $backTrace = #0 [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(433): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [cms.root]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(GuzzleHttp\Exception\RequestException))
#2 [cms.root]/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:3))
#3 [cms.root]/wp-content/plugins/civicrm/includes/civicrm.basepage.php(380): CiviCRM_For_WordPress->invoke()
#4 [cms.root]/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
#5 [cms.root]/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters("", (Array:1))
#6 [cms.root]/wp-includes/plugin.php(565): WP_Hook->do_action((Array:1))
#7 [cms.root]/wp-includes/class-wp.php(797): do_action_ref_array("wp", (Array:1))
#8 [cms.root]/wp-includes/functions.php(1332): WP->main("")
#9 [cms.root]/wp-blog-header.php(16): wp()
#10 [cms.root]/index.php(17): require("[cms.root]/wp-blog-header.php")
#11 {main}

```

# Answer
This is a very unusual error - but since you appear to be technical (this is a very well-written question!) I can recommend the following:

* Go to **Support menu » Developer » API Explorer**.
* Set *Entity* to **Setting** (see screenshot).
* Set *Action* to **Get**.
* Set the box under *Select* to **ext\_repo\_url**.
* Press **Execute**.
* Look at the *value* in the *Results* box. It should be `https://civicrm.org/extdir/ver={ver}|cms={uf}`

If it's not, it was changed in one of three places:

* `<civiroot>/settings/Extension.settings.php` (`ext_repo_url` stanza, `default` value). This is unlikely, since it would go away on upgrade.
* In the database. In that case, set the *Action* to **Set**, the box under *Values* to **ext\_repo\_url**, and paste the URL above into the input box that appears. Press **Execute**, then check that it worked with the "Get" instructions above.
* If it still hasn't changed, the only place that has higher precedence is in `civicrm.settings.php`. Comment out any lines that have `ext_repo_url` in them, there's no good reason that this should be overridden in `civicrm.settings.php` unless you're a cloud provider of a fleet of CiviCRM instances.
> 2 votes

# Answer
You're running a very old version of CiviCRM and the code that's giving you the error has changed since that version. Can you upgrade?
> 1 votes

---
Tags: extension, error, directory
---


title: No attachments in Searchkit

text:
# Question
Title: No attachments in Searchkit
Is there a possibility to view attachments in recent searchkit? I can't find a reference in entity dropdown. If it's not implemented, do you know where it would fit best?

# Answer
The problem is that EntityFile is not implemented yet in APIv4 (see discussion here). There is File in APIv4, but that just gives you the file data without any connection to the entity it relates to.

You may want to comment on that PR to see if it can be moved forward.
> 1 votes

---
Tags: searchkit
---


title: Creating extensions for custom tables

text:
# Question
Title: Creating extensions for custom tables
we have some custom tables and in the menu, Support -\> Developer -\> Api Explorer v4, currently those custom tables are not available. Since we are new to this, in order for those custom tables to appear, we need to create our own extensions, install it then we can use it thru the APi Explorer v4, is it correct? Please give your suggestions. Thanks

# Answer
> 3 votes
It sounds like what you are asking about are Custom Field Groups.

A Custom Field Group is generally not accessible from the API as an entity. Instead, you access the Custom Fields within the Custom Field Group on the relevant entity (e.g. if you have a Custom Field Group for Contacts called mygroup and a Custom Field within it called myfield, you can access mygroup.myfield on the Contact entity).

The only exception to this is Custom Field Groups that allow multiple values, which is only possible for Contacts. For these, the Group is accessible as an API Entity.

# Answer
> 0 votes
If you have database tables you created outside of CiviCRM, they can't be exposed to API4. API4 relies on metadata stored in the DAO file for the entity, which you don't have. To rectify this, you should use `civix` to generate an extension, to create an XML representation of your data, and to generate the DAO boilerplate.

You should instead then export table, remove it, and install the extension. This will install the newly-defined table. If it doesn't exactly match the old table, uninstall and try again until it does. Then you can reimport the table to restore your data (if there was no data in the table this is unncecessary).

Then, finally, you can place a file in your extension at `Civi/Api4/Yourentity.php` that reads:

```
<?php

namespace Civi\Api4;

/**
 * Yourentitiy
 *
 * @searchable secondary
 * @since 5.65
 * @package Civi\Api4
 */
class Yourentity extends Generic\DAOEntity {

}

```

Clear cache, and it should be in API4.

---
Tags: custom-fields, extension, apiv4
---


title: Is it OK to truncate log tables?

text:
# Question
Title: Is it OK to truncate log tables?
I've got detailed logging turned on, and everything is getting stored in a separate DB, but it's getting pretty big. Is it OK simply to truncate the tables? Clearly I'll lose the data, and the ability to roll back changes, but I need to keep the size of the database under some sort of control. If so, how could I delete everything older than say, the last 3 months? This post offers some clues on that.

# Answer
> 2 votes
Yes you can delete/truncate the log tables. It's not used for anything except the change log / manual investigations.

That post you linked to answers your second question: `DELETE FROM log_civicrm_XXX WHERE log_date < DATE_SUB(NOW(), INTERVAL 3 MONTH)`

---
Tags: db-logging
---


# Question
Title: Blocking Registration of other participant
Using on line registration in CiviEvent, I can check the box 'Register multiple participants'. For an specific event I don't want that so I don't check that box.

when I **log in** before registration, I get the notice above the registration fields:

*Welcome Betty Dolfing. (Not Betty Dolfing, or want to register a different person?)*

and then I can click on the link to register a different person.

Question: I don't want this option that participants can register others as well and even have the opportunity to 'look up' people in CiviCMR. How can I get rid of that? It seems a default thing for logged in accounts. I'm using Drupal 7 with CiviCRM 4.6.22. I tried to switch on and off several permissions in Drupal but haven't found the solution yet.

# Answer
To do the same, I use 2 Webforms :

* one public (authenticated users) which is limited to their own registration (existing contact hidden)
* one, almost identical, reserved to an administrative role which enables different persons registration.

You may need the permission per webform Module (https://www.drupal.org/project/permissions\_per\_webform)
> 3 votes

# Answer
I did found a different approach for removing option to registered additional member

I did by creating a Page run hook (civicrm Extension) with the below condition

```
function example_civicrm_pageRun(&$page){
$pageName = $page->getVar('_name');
if ($pageName == 'CRM_Event_Page_EventInfo') {
     $allStatus = CRM_Core_Session::singleton()->getStatus();
     foreach ($allStatus as $key => $status) {
         if (str_contains($status['text'], 'already registered for this event') && $status['type'] == 'alert') {
CRM_Core_Session::singleton()->getStatus(TRUE);
CRM_Core_Session::singleton()->setStatus("<h3'>It looks like you are already registered for this event.</h3>");
}}}}

```

I hope this helps !!!
> 2 votes

# Answer
This won't prevent the link from being offered, but you can deny permission once it's clicked (and use your own conditional logic) by implementing hook\_civicrm\_permission\_check and checking for the cid=0 parameter:

```
function your_module_civicrm_permission_check($permission, &$granted) {
  if ($permission == 'register for events' && CRM_Utils_System::currentPath() == 'civicrm/event/register') {
    $decodedUrl = urldecode($_SERVER['REQUEST_URI']);
    $queryString = parse_url($decodedUrl, PHP_URL_QUERY);
    parse_str($queryString, $params);
    if (isset($params['cid']) && $params['cid'] == 0) {
      CRM_Core_Session::setStatus('Registering on behalf of others is not supported for this event');
      $granted = false;
    }
  }
}
```
> 2 votes

---
Tags: civievent, registration
---


# Question
Title: Formbuilder relationships - Autofill several relationships
## **Summary**

This is a follow up question of that one, that I asked a year ago when FormBuilder was not as advanced as today. There was no easy solution, now there is almost one, so a big thx and congrats to the FormBuilder developpers :)

Our use case is probably very common : a form where a parent can fill in his own data and the data of his two children, with "parent of / child of" relationships.

We would like the names and data of the parent and related children to be auto-filled, if already present in Civicrm, and this is where we are **failing for the second child**.

* Parent autofill : ok
* Child 1 autofill : ok
* Child 2 autofill : NOT ok, it is autofilled with the data of Child 1 :(

---

## Details

This form seems to work as expected to create new parent and children from a blank form

Then we use the email token in Civimail, so that existing Parents can update their data and children.The email token is `{afform.afformTestLink}`

Autofill is working ok for the parent, and one child

**For Parent1 :**

**For Child 1**: "child of / current user"

**For Child 2**: same as child 1, although the parent as 2 different children already related to him in civicrm

## PROBLEM

child 2 is autofilled with the same data as child 1 :(

# Answer
> 2 votes
The answer of @Coleman above was perfect, I could even do more than expected. Detailed solution below.

Tabs in the form :

* parents
* related children
* relationship

Related children are autofilled as "Child of current user", and made a repeating entity

Parents are autofilled as "Parent of related children", and also repeating entity. With this trick, we get the data of the other parent :)

# Answer
> 2 votes
Well articulated question! I noticed in your screenshot that you have 2 child entities on the form. They are both being filled in the same way, so they both get the same result. Not what you want, but I understand why the computer would do that .

I think you might get your desired result if you only have 1 child entity on the form, and make it a repeating entity. If you still want a maximum of 2 you can configure a limit to the repeat setting.

---
Tags: relationships, formbuilder
---


# Question
Title: Removing ability to register a different person who is a non-member
I've seen a few references to this problem here and in the old forums, but not a real solution without hacking/overriding.

We have a "Members only" event. But at the very top, a link is provided that allows for a member to register a non-member:

Welcome Rob Brandt. (Not Rob Brandt, or want to register a different person?)

How to prevent this?

# Answer
> 1 votes
We used CSS to hide that message. Users won't click a link or take an action they don't know they can do! haha It's stupid simple but it works and we haven't had a problem since.

Here's the CSS we used:

```
/* Prevent people from enroling / contributing for someone else */
.crm-not-you-message {
    display: none;
}

```

---
Tags: civievent, civimember
---


title: CiviMailings stuck on 'running'

text:
# Question
Title: CiviMailings stuck on 'running'
We run CiviCRM 4.6.2 with Wordpress 4.2.3. I have run a couple of large Mailings recently and they get stuck 'running'. I know some recipients have received them although the reports say 0% have been delivered. I don't want to execute the cron job again as previously some recipients then received the mailing twice.

Any ideas?

# Answer
> 2 votes
You might check the mailing list itself, as we have seen mailings get stuck due to an improperly formatted/invalid email address on the list. Another idea might be to split your list in half and send the mailing in two groups, in case the mailing size is an issue with your server.

Good luck, Lesley

# Answer
> 2 votes
This is very late, but this answer might be useful for others.

We have seen this a couple of times. Usually it is caused by an error code due to some limits on the SMTP server as @Lesley Carter mentioned.

Unfortunutately CiviMail does not capture and display these anywhere as far as I can tell. So you have the get into the logs of your mailing software.

As to duplicate sendings you can actually make a group of those that have already received the mailing using "Report" and listing all successful deliveries. You can then use that group to "Not include" when you do your second round.

---
Tags: civimail
---


# Question
Title: How to Search for Contacts stored in a Contact Reference Custom Field
Got a Civi newbie question.

I'm looking to use a Contact Reference custom field as a foreign key in a many-to-one entity relationship, but I don't see how to build the search query properly in SearchKit.

Imagine that I've got this setup:

* **Regional offices** as Organization subtypes.
* **Local offices** as Organization subtypes. Since a local office can belong to only 1 regional office, I create a custom field for Local offices that references the parent Regional office.
* **Individual** type contacts can be members of local offices. Again since Individuals can only belong to 1 local office, I create a custom field for Individuals referencing the Local office.

When viewing a Regional Office contact, I want to display a tabular report showing the list of Local offices and a count of the number of members (Individuals) belonging to that Local office.

Viewing contact: Regional office = **US East Coast**

| Local office | Number of members |
| --- | --- |
| New York | 1,245 |
| Boston | 837 |
| Philadelphia | 469 |

In quasi-SQL I would write something like:

```
SELECT local_office.name, COUNT(member.id) as NumberOfMembers
FROM civicrm_contact regional_office
LEFT JOIN civicrm_contact local_office ON local_offices.fk_regional_office_id = regional_office.id
LEFT JOIN civicrm_contact member ON member.fk_local_office_id = local_office.id
WHERE regional_office.contact_sub_type = "RegionalOffice"
AND regional_office.id = <URL.id>
ORDER BY NumberOfMembers DESC

```

I have searched the forums and documentation but haven't found a clear answer.

In this post, Aidan seems to indicate this is not possible with Contact Reference custom fields: "Lack of searchability is one of the downsides to using Contact References." https://civicrm.stackexchange.com/a/35646/15346

I don't want to use Civi's Relationships because they're more suited to many-to-many entity relationships and would require overhead to ensure the fk relationships stay as many-to-one.

What's the best way to achieve this without resorting to Relationships? Thanks

---

Civi 5.62.1 Drupal 10

# Answer
You'll be able to do this if you upgrade to 5.63. In that version, custom "EntityReference" fields are fully supported as joins. See https://github.com/civicrm/civicrm-core/pull/26192

FYI I recommend you check your custom fields and ensure you are using the new "EntityReference" field type and not the old "ContactReference" type which is not as well supported.
> 2 votes

---
Tags: contacts, custom-fields, searchkit, contact-reference
---


title: CiviCRM System Status warning

text:
# Question
Title: CiviCRM System Status warning
Can you please give your suggestions to help to solve the following system status warning?

(1) The CiviCRM debug log should not be downloadable.

(2) Files in the data directory (/var/www/html/wordpress/wp-content/uploads/civicrm/upload/) should not be downloadable.

(3) Files in the data directory (/var/www/html/wordpress/wp-content/uploads/civicrm/custom/) should not be downloadable.

(4) Outdated tokens in use - Please review your contribution\_invoice\_receipt message template and remove references to the token {$display\_name} as it has been replaced by {contact.display\_name}.

For (1),(2),and (3), can we solve the problem by setting the directory using ckmod 700? Many Thanks!

# Answer
> 4 votes
For {$display\_name}, this was changed in the template two years ago. Can you revert the template to the default to get the updated version? Of if you have customizations, you'll want to apply them to the updated template.

For the access issues, these should be covered by .htaccess files in those directories. Can you check that those files are present and if so, what the contents are?

The .htaccess files should contain:

```
<Files "*">
# OpenLiteSpeed 1.4.38+
  <IfModule !authz_core_module>
    RewriteRule .* - [F,L]
  </IfModule>

# Apache 2.2
  <IfModule !authz_core_module>
    Order allow,deny
    Deny from all
  </IfModule>

# Apache 2.4+
  <IfModule authz_core_module>
    Require all denied
  </IfModule>
</Files>

```

The debug log is the ConfigAndLog folder in the same place as the upload and custom folders.

---
Tags: system-status
---


# Question
Title: Why won't CRM.loadForm render url containing civicrm/a/#?
This call:

```
CRM.loadForm(CRM.url('civicrm/a/#/tournament'));

```

works very well for any url that does NOT contain 'civicrm/a/#'. As soon as I try to open anything from an extension, the popup stays 'white.' No errors. Just ... white.

Is there a way to make that work for such url?

# Answer
How about just plain javascript:

window.open(CRM.url('civicrm/a/#/tournament'), 'mywindow', 'scrollbars=yes');

Obviously 2nd and 3rd parameters can be whatever you want.

Works on dmaster.demo.civicrm.org (with 'civicrm/a/#/caseType/new', since I assume "tournament" is something custom).
> 0 votes

# Answer
`civicrm/a` is a fullscreen-only page and cannot be opened in a popup. However, recent work in Afform (FormBuilder) *does* allows Afforms to be loaded in a popup, which would give you the functionality you want. Simply call:

```
CRM.loadForm(CRM.url('civicrm/path/to/my-afform'));

```
> 0 votes

---
Tags: api, extension, urls
---


# Question
Title: Drupal 9 View unable to display logged in User
I have an issue that I think relates to this question:

Drupal 9 View Shows Permission Denied For CiviCRM Tables

and possibly this:

Views integration error on D9

The Views I have recreated from my D7 install are all fine except for one use case - a contextual filter on the logged-in user. The View shows CiviCRM cases and I need to display those cases where the logged in user is the client. So this involves relating the two together via CiviCRM's `uf_match` table. It works fine on D7.

The SQL error I get on a local dev setup is:

```
SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'civicrm'@'172.18.0.4' for table 'users_field_data': SELECT "civicrm_case"."id" AS "id", "civicrm_contact_civicrm_case_contact"."id" AS "civicrm_contact_civicrm_case_contact_id", "users_field_data_civicrm_uf_match"."uid" AS "users_field_data_civicrm_uf_match_uid" FROM "civicrm_case" "civicrm_case" INNER JOIN civicrm_dev.civicrm_case_contact "civicrm_case_contact" ON civicrm_case.id = civicrm_case_contact.case_id INNER JOIN civicrm_dev.civicrm_contact "civicrm_contact_civicrm_case_contact" ON civicrm_case_contact.contact_id = civicrm_contact_civicrm_case_contact.id LEFT JOIN civicrm_dev.civicrm_uf_match "civicrm_contact_civicrm_case_contact__civicrm_uf_match" ON civicrm_contact_civicrm_case_contact.id = civicrm_contact_civicrm_case_contact__civicrm_uf_match.contact_id LEFT JOIN drupal_dev.users_field_data "users_field_data_civicrm_uf_match" ON civicrm_contact_civicrm_case_contact__civicrm_uf_match.uf_id = users_field_data_civicrm_uf_match.uid WHERE ((civicrm_case.case_type_id = :civicrm_case_case_type_id)) AND ((civicrm_case.status_id = :civicrm_case_status_id)) AND ((users_field_data_civicrm_uf_match.uid = :users_field_data_uid)) LIMIT 11 OFFSET 0; Array ( [:civicrm_case_case_type_id] => 20 [:civicrm_case_status_id] => 1 [:users_field_data_uid] => 1 )

```

I have CiviCRM Entity installed (3.5) on D9.5.1 using MySQL8. Drupal and CiviCRM are in separate databases. As per the documentation for Views on Drupal 9, I have added a section in my Drupal install's settings.php to include the CiviCRM database - see below. In my old D7 system I needed to add all the CiviCRM tables in a separate array and no longer do that as per the documentation and from what I can glean elsewhere. Drupal has SELECT rights on the CiviCRM database, again as per the documentation (unchanged from D7).

```
$databases['civicrm']['default'] = array(
  'database' => 'civicrm_dev',
  'username' => 'civicrm',
  'password' => 'civicrm',
  'prefix' => '',
  'host' => 'db',
  'port' => '3306',
  'namespace' => 'Drupal\\mysql\\Driver\\Database\\mysql',
  'driver' => 'mysql',
  'autoload' => 'core/modules/mysql/src/Driver/Database/mysql/',
);

$databases['default']['default'] = array(
  'database' => 'drupal_dev',
  'username' => 'drupal',
  'password' => 'drupal',
  'prefix' => '',
  'host' => 'db',
  'port' => '3306',
  'namespace' => 'Drupal\\mysql\\Driver\\Database\\mysql',
  'driver' => 'mysql',
  'autoload' => 'core/modules/mysql/src/Driver/Database/mysql/',
);

```

What is interesting is that it is the `civicrm` user that has the access violation, not `drupal` (as it always used to be when I had a new CiviCRM custom field and forgot to update the `civicrm` table array in `settings.php`...)

**I can solve this problem easily by simply giving the `civicrm` database user SELECT rights to the `drupal` database**, as I did for the `drupal` database user on the `civicrm` database. Effectively giving each side the rights to view each other's database - but this seems wrong given the purpose of the CiviCRM Entity module.

So is this a poorly configured View in D9, a missing step or incorrect config, or have I stumbled on an issue?

# Answer
> 3 votes
As per the comment by jackrabbithanna, the solution in this case is to give the civicrm database user SELECT rights on the Drupal Database.

I think it is an odd solution given the way I thought Views and CiviCRM Entity worked, but it at least a simple one!

---
Tags: drupal-views, civicrm-entity
---


# Question
Title: containers and updating process for extensions
while the website documents the upgrading process for civicrm itself, i noticed this seemed to touch less upon general tips for updating its extensions.

now i've heard advice to in general first perform a process of 'update extension, run DB upgrades, clean caches' for the more basic extensions, to only then run similar steps for extensions built on top of those.

i'd like to deploy civicrm using a docker container tho, with any extensions built into the container image. in that type of scenario, the above process would end up somewhat more cumbersome, as you'd end up having creating intermediate images to update only part of the extensions used.

hence i was wondering, does the advice to only sequentially update civicrm extensions make sense? or should one generally be able to get away with deploying an image updating any used extensions to their newer versions?

# Answer
I think that advice is somewhat outdated. Recently, CiviCRM has gotten better about upgrades, in fact the same command will upgrade both CiviCRM core + all installed extensions: `cv upgrade:db`. Extensions are internally sorted and upgraded in order of their dependencies. Not all extensions have opted-in to being sorted yet, but a lot of those don't have any dependencies so it's not a problem.
> 2 votes

---
Tags: upgrade, extension
---


# Question
Title: error (infinite loop ?) when using formbuilder + autofill + autocomplete existing user
## Summary

Our use case is probably very common : a form where a parent can fill in his own data and the data of his children, with "parent of / child of" relationships.

In order to avoid creation of duplicate children (and because we have found out that Deduper does not work if there is an hyphen in the name), we use a workaround with Searchkit + Autocomplete + Formbuilder, so that parents can pick up their children already existing in our civicrm.

Problem: if we use autofill to display the children already with a "child of" relationship, then the content of some fields blink and changes endlessly

Bug ? Missing feature ? Something wrong in our setup ?

## Details

**Searchkit** : a basic contact search, where sub-type = child

**Autocomplete in Searchkit** : a basic configuration showing the full name of the child. Works well in preview in Searchkit / Autocomplete page

**Formbuilder** A basic form with individual (multiple), a search box "existing user", leveraging the autocomplete described above. In open access. Autofill : child of current user

What happens : on screenshot below, the content of the red field alternate very rapidely (creating a "blinking" effect) between :

* empty
* 9845 (which is the contact ID of Bart Simpson)
* Bart Simpson

Then if we click on "add" to creation an additional child, it gets worse : the 3 yellow fields have the same blinking / alternating problem, their content cycle between Bart Simpson and Lisa Simpson (the 2 children)

Then if in the green box we select "Hugo Simpson", then the yellow fields have the blinking / alternating problem, they cycle between Hugo and Lisa (note that Bart seems to have disappeared ;). And the name fields below the green field remain empty

# Answer
> 2 votes
That was indeed a bug in FormBuilder. Multiple bugs in fact. I've fixed them all in this PR: https://github.com/civicrm/civicrm-core/pull/27121

You can help by reviewing the PR, you'll find instructions for doing so right under the description (in the comment posted by CiviBot).

---
Tags: searchkit, formbuilder, autocomplete
---


# Question
Title: What parts of the civicrm filesystem's "local data files" can be converted to e.g. S3?
Drupal has a project called "S3 filesystem" which allows a site to put some of it's "files" on a remote S3 bucket (or other object-based filesystem). It works because Drupal accesses files through a pluggable api.

It appears that most civicrm access of its "local data files" is now programmatic, i.e. those files are rarely accessed based on an assumption of where they are relative to the document root, so it seems like it might not be too far off that all of civicrm core's file access could be pluggable and a civicrm extension similar to the s3 filesystem possible.

Any thoughts about this? I'm particularly interested in the files in customFileUploadDir.

# Answer
1. Tim has answered this (as of Apr 2023) here:

https://lab.civicrm.org/dev/core/-/issues/4251#note\_90037

Short version is: yes, a more consistent api for file serving is under consideration, it's currently a bit of mess, but with an entertainingly written back story.
2. For the narrower question of "how would I do something like this now", the answer would be to look at this file:

https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/BAO/File.php

which contains the methods for managing (uploading, moving, etc.) "entity files", i.e. those that are attached to an entity, which probably is the main scalability concern.
3. @bgm has answered a different question of "how can I use S3 to host my CiviCRM uploaded files" with a straightforward solution of using the S3 Fuse filesystem. That might be the best way to solve my specific issue of scalability, by mounting a bucket to customFileUploadDir. The potential downside is that it relies on translating low level filesystem requests, which means some types of operations might be quite inefficient (e.g. big directory listings).
> 2 votes

---
Tags: filesystem
---


# Question
Title: Searchkit deselect with group by option and how to save the sorting
I have two questions: How can I save the sorting of the results in a Searchkit search so that, for example, used in a dashlet, it always shows the most recently changed contacts at the top? and If I have created a search with several tags and then display the tags in the results, it makes sense to group them according to the display names. But when I want to select individual contacts, it always selects all of them. How can I solve this? Thanks for the help!

About the second question: I recorded a video for you.

https://speicher.dienstleistungskombinat.de/s/E2bystCZt6f32br

# Answer
In the settings for your SearchDisplay, near the top of the page, you can set Sort by Modified Date (even if Modified Date isn't a column in your Display).

I'm not quite sure what you are asking in your second question, could you perhaps post some screenshots of your search and a description of what you want the result to look like?
> 1 votes

# Answer
To the 2nd part of your question, I believe you hit a bug. Please see this fix: https://github.com/civicrm/civicrm-core/pull/27123
> 0 votes

---
Tags: searchkit
---