Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
14ffdf25
Unverified
Commit
14ffdf25
authored
3 years ago
by
Eileen McNaughton
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #20719 from mattwire/deprecatedwarningcaller
Add calling function to deprecatedWarning log message
parents
392c3dcb
f87a8e30
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CRM/ACL/API.php
+2
-0
2 additions, 0 deletions
CRM/ACL/API.php
CRM/ACL/BAO/ACL.php
+2
-0
2 additions, 0 deletions
CRM/ACL/BAO/ACL.php
CRM/Core/Error.php
+8
-1
8 additions, 1 deletion
CRM/Core/Error.php
with
12 additions
and
1 deletion
CRM/ACL/API.php
+
2
−
0
View file @
14ffdf25
...
...
@@ -38,6 +38,8 @@ class CRM_ACL_API {
*
* @return bool
* true if yes, else false
*
* @deprecated
*/
public
static
function
check
(
$str
,
$contactID
=
NULL
)
{
\CRM_Core_Error
::
deprecatedWarning
(
__CLASS__
.
'::'
.
__FUNCTION__
.
' is deprecated.'
);
...
...
This diff is collapsed.
Click to expand it.
CRM/ACL/BAO/ACL.php
+
2
−
0
View file @
14ffdf25
...
...
@@ -188,6 +188,8 @@ SELECT acl.*
* @param int $contactID
*
* @return bool
*
* @deprecated
*/
public
static
function
check
(
$str
,
$contactID
)
{
\CRM_Core_Error
::
deprecatedWarning
(
__CLASS__
.
'::'
.
__FUNCTION__
.
' is deprecated.'
);
...
...
This diff is collapsed.
Click to expand it.
CRM/Core/Error.php
+
8
−
1
View file @
14ffdf25
...
...
@@ -1039,16 +1039,23 @@ class CRM_Core_Error extends PEAR_ErrorStack {
$callerClass
=
$dbt
[
1
][
'class'
]
??
NULL
;
$oldMethod
=
"
{
$callerClass
}
::
{
$callerFunction
}
"
;
}
self
::
deprecatedWarning
(
"Deprecated function
$oldMethod
, use
$newMethod
."
);
$message
=
"Deprecated function
$oldMethod
, use
$newMethod
."
;
Civi
::
log
()
->
warning
(
$message
,
[
'civi.tag'
=>
'deprecated'
]);
trigger_error
(
$message
,
E_USER_DEPRECATED
);
}
/**
* Output a deprecated notice about a deprecated call path, rather than deprecating a whole function.
*
* @param string $message
*/
public
static
function
deprecatedWarning
(
$message
)
{
// Even though the tag is no longer used within the log() function,
// \Civi\API\LogObserver instances may still be monitoring it.
$dbt
=
debug_backtrace
(
DEBUG_BACKTRACE_IGNORE_ARGS
,
3
);
$callerFunction
=
$dbt
[
2
][
'function'
]
??
NULL
;
$callerClass
=
$dbt
[
2
][
'class'
]
??
NULL
;
$message
.
=
" Caller:
{
$callerClass
}
::
{
$callerFunction
}
"
;
Civi
::
log
()
->
warning
(
$message
,
[
'civi.tag'
=>
'deprecated'
]);
trigger_error
(
$message
,
E_USER_DEPRECATED
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment