Skip to content

Commit bd9d888

Browse files
committed
Cannot edit single contact from Edit Selection on Contacts list page #2040
1 parent d42b3b7 commit bd9d888

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

modules/profile/profile_new.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
$getCopy = admFuncVariableIsValid($_GET, 'copy', 'bool');
3636
$getAcceptRegistration = admFuncVariableIsValid($_GET, 'accept_registration', 'bool');
3737
$getUserUuids = admFuncVariableIsValid($_GET, 'user_uuids', 'array', array('defaultValue' => array()));
38+
$editSelection = true;
3839
if (empty($getUserUuids)) {
40+
$editSelection = false;
3941
$getUserUuids = admFuncVariableIsValid($_POST, 'uuids', 'array', array('defaultValue' => array()));
4042
$getUserUuids = array_map(function($uuid) {
4143
return preg_replace('/row_members_/', '', $uuid);
@@ -644,7 +646,7 @@ function toggleProfileFields(fieldIdPrefix) {
644646

645647
// check form field input and sanitized it from malicious content
646648
$profileEditForm = $gCurrentSession->getFormObject($_POST['adm_csrf_token']);
647-
$formValues = $profileEditForm->validate($_POST, (count($users) > 1));
649+
$formValues = $profileEditForm->validate($_POST, $editSelection);
648650

649651
// loop over all users and save the data
650652
foreach ($users as $user) {

src/UI/Presenter/FormPresenter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,7 @@ public function getCsrfToken(bool $newToken = false): string
21182118
* valid format. The method will return an array with all form input with sanitized html
21192119
* from editor fields and html free content of all other fields.
21202120
* @param array $fieldValues Array with field name as key and field value as array value.
2121+
* @param bool $editSelection Set to **true** if a selection of objects should be edited.
21212122
* @return array Returns an array with all valid fields and their values of this form
21222123
* @throws Exception
21232124
*/

0 commit comments

Comments
 (0)