Add deprected warning to apparently unused functions
authorColeman Watts <coleman@civicrm.org>
Thu, 29 Apr 2021 15:59:46 +0000 (11:59 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 29 Apr 2021 15:59:46 +0000 (11:59 -0400)
It looks like one check function is only ever called by the other,
and the other isn't called from anywhere.

What these functions are supposed to do is unclear.
The code comment appears to be wrong; the variable $str
is not a permission string but is inserted into a query
as civicrm_acl.object_table.

CRM/ACL/API.php
CRM/ACL/BAO/ACL.php

index 17982fb7baa92c3cc9ded987094c8b501dc071e1..19c71c7924a9c3a411ed51b3997d3a437b8784f9 100644 (file)
@@ -40,6 +40,7 @@ class CRM_ACL_API {
    *   true if yes, else false
    */
   public static function check($str, $contactID = NULL) {
+    \CRM_Core_Error::deprecatedWarning(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated.');
     if ($contactID == NULL) {
       $contactID = CRM_Core_Session::getLoggedInContactID();
     }
index aecd6a40cf3591b794f52c82db50c43fb2b8c7be..6eb5d2fdcafc312876e94e0c16c010922fe5daf0 100644 (file)
@@ -190,6 +190,7 @@ SELECT acl.*
    * @return bool
    */
   public static function check($str, $contactID) {
+    \CRM_Core_Error::deprecatedWarning(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated.');
 
     $acls = CRM_ACL_BAO_Cache::build($contactID);