Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [users]

One of the most important entities Drupal uses is the user entity.

0
votes
0answers
20 views

Username must match a number taken from a given database table [on hold]

I work for a telephone and Internet provider company. Our users are identified by their personal ID number (this is not in US, everyone has an ID card known as DNI, given by the government). I am ...
2
votes
0answers
18 views

How do I import only user-related fields?

I am trying to do data migration from a Drupal 7 site to a Drupal 8 site. (No other entities are migrated). I am trying to import users which has 5-7 fields and I tried to import fields using: ...
0
votes
0answers
8 views

Why do I get “Type does not correspond to an entity on this site” when POSTing to REST api behind an Apache Reverse proxy?

I have the REST api configured to allow POSTing new users to /entity/user. On my local machine, it works just fine. Once I push up to my remote host, it stops working. The key difference is that on ...
-1
votes
1answer
34 views

How to Restrict some special character in password field

I'm very new in Drupal, I would like to restrict some special characters from user password field Is there any way to edit configuration of core modules i'm trying to create preg_match modules . i ...
0
votes
0answers
28 views

D7: user_check_password() returns false but password didn't change

We've been having quite an unusual issue with Drupal: at seemingly random times it decides the password hashes for all users are invalid, and they have to do a password reset to be able to log back in ...
-1
votes
0answers
9 views

Entity Reference Filter: Filter users custom field

I have created content type which has various fields. One of its field showing list of users in the system as an select box (option to select user). I want to filter that list of users(people) based ...
0
votes
1answer
24 views

How to check if a password reset token is still valid?

Is there a way to hook into the user_pass_reset form to detect if the provided hash is valid? Currently it seems to just throw a 403 error when submitting the form if the hash has already been used to ...
-2
votes
0answers
19 views

How to give ability for new usera to activate their accounts without admin confirmation throu links from email?

How to give ability for new users to activate their accounts without admin confirmation throu links from email? Is Drupal 8 have this ability (prefereble) or maybe some simple module I can install to ...
0
votes
0answers
29 views

User not logged in

I have a Drupal 8 installation and it is not logging in the users. Tried Google search and applied all solutions like setting cookie_domain, trusted_host_patterns and clearing cache. Note that, if ...
0
votes
1answer
26 views

Get Username from UID with Preprocess for Template

I'm a bit lost at finding the username based on the uid. I get the uid from the address using: $current_path = \Drupal::service('path.current')->getPath(); $urluid = (explode("/",$...
0
votes
1answer
14 views

Programatically copy an image from user entity to webform submission entity [closed]

Using a custom webform handler, I am trying to copy an image from the image field (field_usr_avatar_img) located at the user account page to the image element (avatar_img) located at the webform ...
1
vote
1answer
22 views

Are changes to the user status stored somewhere?

I've made a pretty serious error of judgement creating a view for a client that shows users created before a date AND still active. The error was adding a date filter. This was meant to be used at ...
0
votes
1answer
28 views

Provide autocomplete field with user's Display Name

Drupal core already supports autocompletion of username fields. However is there a way to provide autocomplete for user's Display Name? Since this is a virtual field, a database query with % like ...
-1
votes
1answer
53 views

Export/import users

I am looking for a way to export users from one Drupal 8 Site into another Drupal 8 site. Is it possible to do this by exporting and importing the Users tables? If so which ones? I see there are ...
0
votes
1answer
14 views

How to use view's relationships to pull user entity reference data?

I created 2 new user fields for the user (object/entity) on my D7 site. Using views, I can select 'content' or 'user' for querying data. When I use views to query the 'user', the 2 new fields come up ...
0
votes
0answers
16 views

Filter content moderation view according to user roles that I currently login to the site

The view I try to filter is only accessible to authenticated users and they have defined roles, that is, it is an administration view. I have several types of content and I want to show in the ...
0
votes
1answer
62 views

Programmatically get the results of a view

Using the group module in D8, I have the below view with machine name: group_members_per_group Machine Name of: (Member account) User: Full Name is: field_user_full_name (Member account) User: ...
-2
votes
2answers
74 views

How do I redirect a user to the front page after logging in? [closed]

Is there a way to redirect users to the front page after they log in, without using any additional modules other than the core modules. Right now they are redirected to their profiles.
0
votes
1answer
94 views

Alter views exposed form

I have a view that in that view I set up 3 exposed filter, all working fine. I need to set a condition to show the third filter option to a specific user, it can be checked according to the user role, ...
0
votes
0answers
9 views

Drupal Open Social - How add new user fields to user information page?

I've a local installation of Drupal 8's distribution Open Social (DevDesktop). I added some new fields (f.e. birthday, skypename,...more fields to add) to the user's profile. Each user is able to ...
0
votes
1answer
36 views

Reference current user when creating a content type

I am creating a new content type and one of the fields I d like to add owner. I ve chosen reference - user as the field type Type of item to reference = user How do I make the default value the ...
0
votes
1answer
33 views

How do I know what setSetting is suppose to be?

I am creating a custom content entity and in the BaseFieldDefinitions, I am trying to create a field for assigning a user as the designated assigner and will follow up with a assignee. So far, the ...
0
votes
0answers
24 views

How to handle submit of a form that extends RegisterForm?

I have a form that extends the native RegisterForm When this form is submitted, I would like to register a user, but then I would also like to store the uuid & certain fields like name & ...
0
votes
2answers
96 views

Password reset link gives access denied

Password reset link is not working in drupal 8.6. The email with the one-time login link is sent just fine, but when the user clicks on the Login button, they get "You are not authorized to access ...
2
votes
0answers
20 views

How to tease access control content to non-authenticated users [closed]

I have member only content and using Roles and Access Control to serve it up. The goal is to display member only content in a view block to non-authenticated users so they would click on it but be ...
1
vote
1answer
33 views

Print Preprocessed username Field Value in User Template

$account->getDisplayName() Bypasses "username" Field Preprocessing in User Template? I am trying to print the value of the username field of the user account in a user--custom.html.twig file. ...
0
votes
1answer
102 views

Changing a Profile type Machine Name broke the Admin/People search

I'm working on a Drupal 7 website in which there are several Profile types. As part of a task, I had to change the "Label Name" and the "Machine Name" of one of them: specifically Professional ...
1
vote
0answers
53 views

How do I override the registration form?

I am trying to override the user registration form in Drupal 8, using the following code. RouteSubscriber.php namespace Drupal\registration_subscription\Routing; use Drupal\Core\Routing\...
0
votes
0answers
21 views

Show User Comments and/or Voting API on User/Profile Page

I have searched the internet for 24 hours now I can't seem to figure where I am going wrong here. I am attempting to add comments to the user profile page. The field to choose your selection to ...
2
votes
1answer
63 views

How to create a permission with logic

I need to create a permission to allow users to see the content overview page (/admin/content) only during business hours (9 AM to 5 PM). Drupal core comes with the "Access the Content overview page" ...
1
vote
1answer
57 views

Get the custom fields created for User entity in Drupal8

I was trying to get the custom fields created for User entity in Drupal8: Drupal::service('entity_field.manager')->getFieldStorageDefinitions('user') is returning all the fields Drupal::service('...
0
votes
1answer
96 views

Associate Every Displayed User Name With Corresponding users.data Table Row

Updated: I would like data from the users.data table displayed with every "User Name" however it is displayed. As an example, I have this in hook_preprocess_page_title(): function ...
0
votes
0answers
21 views

Drupal logout link does not hide the admin toolbar

I am experiencing some odd behavior around the logout process in Drupal 8. When I am logged in as admin and then logout, using either the Drupal "Log out" link or by appending "/user/logout" to the ...
0
votes
1answer
50 views

Let 'web-view' mobile iOS/Android app talk consume/feed site

I have a Drupal 8 site with the following modules: HAL. HTTP Basic Authentication. REST UI. RESTful Web Services. Serialization. Using the REST UI module, I configured it as follows. Settings for ...
0
votes
1answer
19 views

Show Targeted Content Based on Content Field and User Roles

I'm looking for a way to show specific targeted content based on a content type's field and user role. For example, if user1 has a "Content Group 1" role, then the view should show content pieces ...
1
vote
2answers
29 views

Triggering an action after user resets password?

I was hoping there was hook_user_pass_reset, but I seem to be out of luck. Some background: I made a new field on users called "email_confirmed" This field gets set = 1 when the user has confirmed ...
0
votes
1answer
47 views

How do I programmatically set the preferred language for a user?

I would like to update the preferred_langcode of a user as soon as he changes the language in a language switcher block. I'm already aware of the getPreferredLangcode method mentioned in https://api....
0
votes
3answers
49 views

How can I display a list of users who have the same taxonomy term

The setup: A Taxonomy Vocabulary called "Area of work". The vocabulary has the following associated terms: A, B, C, D, E, F, G, etc. During registration users have to choose a department from the ...
0
votes
1answer
34 views

Cancelling user account set draft pages to published

When we cancelled a user account using the Delete the account and make its content belong to the Anonymous user method, we found that the author was set to Anonymous for the pages they were set as the ...
0
votes
3answers
198 views

Allow access to user information without giving access to view user profile page

The main concern is: Nobody (anonymous/authenticated) has the permission to see the profile of any registered user on the site, so I have UNCHECKED the View user information permission for all roles. ...
0
votes
0answers
82 views

Programmatically logging in users only works with accounts created by the gestor

I'm developing a custom module that should register and login users without use the native Drupal login/register form. The problem is that when I create an user in Drupal gestor, and try log it in, ...
0
votes
1answer
71 views

Custom user login in Facebook Auth modules

I try to run Facebook Login on my Drupal 8 site. I run it by Social API module and with Simple FB Connect, but both module generate user name from first and last name on Facebook. My user will not be ...
0
votes
1answer
73 views

Login user programatically (Create user session)

My question is based on this question: Programmatically User login not working i dont have this clear, to login an user (create an active session) only need use User::Load()? i'm triying make this on ...
0
votes
0answers
33 views

Need to mass delete users

I want to start by saying this is my first dealings with drupal of any kind. I can turn a wordpress site inside and out but have zero experience with drupal. My company has recently inherited a ...
0
votes
1answer
42 views

Permission for private file to anonymous

I have an ad content type, with a file field that is in a private directory when saving the node. Ads and their files are only accesible for authenticated users. I wish I could allow anonymous users ...
0
votes
1answer
42 views

How do I display all terms of nodes created by user in a user view field

I have a User view where I list user information with contextual filter UID. I want to display all the terms from the nodes that the user added. I added the Author relationship so that way I can ...
0
votes
0answers
25 views

Check if a user is logged in using default login form or using email direct login link

I'm working on a Drupal 8 project, my question is: is there any method to check if a user is logged in using email direct link or he did using the default site login form? to check I think the right ...
0
votes
1answer
44 views

How to limit access to vocabulary term by role?

We have two roles: Reviewer and Editor along with two content types: Basic and Article. We have a couple vocabulary terms and taxonomy fields on each content type. Currently only users with Administer ...
0
votes
0answers
57 views

How to get all users with a specific permission

Is there a way to retrieve all users with a specific permission (eg "Post comments"). I only found the possibility to get them by their role: Drupal::entityQuery('user') ->condition('status', 1) -&...
0
votes
0answers
28 views

Field permission seems not working with multiple registration

Can I use these two modules together to create a registration form and limit access to certain fields? Module installed : field permissions multiple registration Wat is working ? The creation of ...