Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
thank you for this awesome module, I found little bug when my site used Realname module. Your widget parse usernames from string when saving form input. It's not good practise, I look into entity reference field, which is using uids EntityAutocomplete::validateEntityAutocomplete
I made quickfix which resolves my issue, I'm happy to create patch but maybe it has other consequences
/**
* Gets the user ids which have been submitted by form.
*
* Users which will gain granted access to taxonomy terms.
*
* @return array
* The user ids which have been submitted.
*/
public function getSubmittedUserIds() {
/* There's a $this->oFormState->getValues() method, but
* it is loosing multiple form values. Don't know why.
* So there're some custom lines on the $_REQUEST array. */
$sRawUsers = $_REQUEST['access']['user'];
if (empty($sRawUsers)) {
return [];
}
$aRawUsers = Tags::explode($sRawUsers);
$aUserIds = [];
if (!empty($aRawUsers)) {
foreach ($aRawUsers as $sRawUser) {
if (preg_match("/.+\s\(([^\)]+)\)/", $sRawUser, $matches)) {
$aUserIds[] = $matches[1];
}
}
}
return $aUserIds;
}
Comment | File | Size | Author |
---|---|---|---|
#3 | realname-compatibility-2916531-3.patch | 1.32 KB | parisek |
Comments
Comment #2
Peter MajmeskuCould you please create a regular patch? Please read this page to learn how to create a patch with Git: https://mobilefish.de/index.php/creating-patch-git
Comment #3
parisekI created patch that is based on core entity reference field
Comment #5
Peter MajmeskuThanks for reporting and the patch! The patch is part of the latest release version 8.x-1.38. See https://www.drupal.org/project/permissions_by_term/releases/8.x-1.38.
Please feel free to re-open this issue, if you have any objections (do not forget to change the issue status).
Comment #6
Peter Majmesku