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
d4d07f8f
Commit
d4d07f8f
authored
2 months ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
Remove BAO_CustomGroup::postProcess deprecated in 5.71
parent
9e1f0054
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Core/BAO/CustomGroup.php
+0
-99
0 additions, 99 deletions
CRM/Core/BAO/CustomGroup.php
with
0 additions
and
99 deletions
CRM/Core/BAO/CustomGroup.php
+
0
−
99
View file @
d4d07f8f
...
...
@@ -1275,105 +1275,6 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup implements \Civi
}
}
/**
* @deprecated since 5.71 will be remvoed around 5.77
* @see CRM_Dedupe_Finder::formatParams
*
* @param array $groupTree
* @param array $params
* @param bool $skipFile
*/
public
static
function
postProcess
(
&
$groupTree
,
&
$params
,
$skipFile
=
FALSE
)
{
CRM_Core_Error
::
deprecatedFunctionWarning
(
'no alternative'
);
// Get the Custom form values and groupTree
foreach
(
$groupTree
as
$groupID
=>
$group
)
{
if
(
$groupID
===
'info'
)
{
continue
;
}
foreach
(
$group
[
'fields'
]
as
$field
)
{
$fieldId
=
$field
[
'id'
];
$serialize
=
CRM_Core_BAO_CustomField
::
isSerialized
(
$field
);
// Reset all checkbox, radio and multiselect data
if
(
$field
[
'html_type'
]
==
'Radio'
||
$serialize
)
{
$groupTree
[
$groupID
][
'fields'
][
$fieldId
][
'customValue'
][
'data'
]
=
'NULL'
;
}
$v
=
NULL
;
foreach
(
$params
as
$key
=>
$val
)
{
if
(
preg_match
(
'/^custom_(\d+)_?(-?\d+)?$/'
,
$key
,
$match
)
&&
$match
[
1
]
==
$field
[
'id'
]
)
{
$v
=
$val
;
}
}
if
(
!
isset
(
$groupTree
[
$groupID
][
'fields'
][
$fieldId
][
'customValue'
]))
{
// field exists in db so populate value from "form".
$groupTree
[
$groupID
][
'fields'
][
$fieldId
][
'customValue'
]
=
[];
}
// Serialize checkbox and multi-select data (using array keys for checkbox)
if
(
$serialize
)
{
$v
=
(
$v
&&
$field
[
'html_type'
]
===
'Checkbox'
)
?
array_keys
(
$v
)
:
$v
;
$v
=
$v
?
CRM_Utils_Array
::
implodePadded
(
$v
)
:
NULL
;
}
switch
(
$field
[
'html_type'
])
{
case
'Select Date'
:
$date
=
CRM_Utils_Date
::
processDate
(
$v
);
$groupTree
[
$groupID
][
'fields'
][
$fieldId
][
'customValue'
][
'data'
]
=
$date
;
break
;
case
'File'
:
if
(
$skipFile
)
{
break
;
}
// store the file in d/b
$entityId
=
explode
(
'='
,
$groupTree
[
'info'
][
'where'
][
0
]);
$fileParams
=
[
'upload_date'
=>
date
(
'YmdHis'
)];
if
(
$groupTree
[
$groupID
][
'fields'
][
$fieldId
][
'customValue'
][
'fid'
])
{
$fileParams
[
'id'
]
=
$groupTree
[
$groupID
][
'fields'
][
$fieldId
][
'customValue'
][
'fid'
];
}
if
(
!
empty
(
$v
))
{
$fileParams
[
'uri'
]
=
$v
[
'name'
];
$fileParams
[
'mime_type'
]
=
$v
[
'type'
];
CRM_Core_BAO_File
::
filePostProcess
(
$v
[
'name'
],
$groupTree
[
$groupID
][
'fields'
][
$fieldId
][
'customValue'
][
'fid'
],
$groupTree
[
$groupID
][
'table_name'
],
trim
(
$entityId
[
1
]),
FALSE
,
TRUE
,
$fileParams
,
'custom_'
.
$fieldId
,
$v
[
'type'
]
);
}
$defaults
=
[];
$paramsFile
=
[
'entity_table'
=>
$groupTree
[
$groupID
][
'table_name'
],
'entity_id'
=>
$entityId
[
1
],
];
CRM_Core_DAO
::
commonRetrieve
(
'CRM_Core_DAO_EntityFile'
,
$paramsFile
,
$defaults
);
$groupTree
[
$groupID
][
'fields'
][
$fieldId
][
'customValue'
][
'data'
]
=
$defaults
[
'file_id'
];
break
;
default
:
$groupTree
[
$groupID
][
'fields'
][
$fieldId
][
'customValue'
][
'data'
]
=
$v
;
break
;
}
}
}
}
/**
* Generic function to build all the form elements for a specific group tree.
*
...
...
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