Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

0
votes
1answer
11 views

Drupal 8 rest login cookie token explanation

When logging in via a POST to user/login?_format=json I'm sent back a response that looks like this { "current_user": { "uid": "233", "name": "test" }, "csrf_token": "...
-2
votes
0answers
8 views

moderation_note-8.x-1.0-beta1 filter list of users based on current logged in user [on hold]

I have installed the group module and also have core workflows and content moderation modules enabled. I have also enabled the moderation_note-8.x-1.0-beta1 module which helps to create a note of the ...
0
votes
0answers
7 views

Edit profile module (edit_profile) removed Cancel account button

I'm using Edit profile module (edit_profile) which is provided with the theme profile. https://www.drupal.org/project/edit_profile This module removes the user account button. Using ...
0
votes
0answers
9 views

Profiles and group integration

Iam Using Group module drupal 8 together with profile module. profile module does not add any permissions for profile creation for the group members. I need to restrict users of certain roles from ...
0
votes
0answers
11 views

Assign permission to existing role programatically [duplicate]

As I searched Internet, I can get answers for Drupal7, but drupal8, I can able to get results like adding new role and assigning permission. Am having a custom module which is installed already, So I ...
0
votes
0answers
15 views

User account creation using Python [on hold]

I have a Python/Flask application which creates user accounts for users across several systems using their APIs. The last application which I need to programmatically create users for is on Drupal 7. ...
0
votes
1answer
21 views

How to grant only certain roles permissons over certain field? [duplicate]

I have a content type with a number of fields. But one of the fields in the edit form must be seen by administer and people with "Reviewer" role. How can i do it?
0
votes
0answers
23 views

How to make a view of a current user (user referenced field ) as well as comments belong to that user in OR condition?

I have one Role. When the user of that role performs login, in their page I am showing a view filtered by user reference field. Now I want to show the comments also belonging to the same user, I have ...
-1
votes
1answer
42 views

Filter two different views using one single filter field

on my Drupal 8 website, i have articles and users with both having the Phone Number field in commun. Note that both articles and users are totally separated and not connected to each other in any way....
0
votes
0answers
55 views

Create a view listing of all [users and articles] available on the website [closed]

On a Drupal 8 website, I have around 1000 users and 5000 article with both having the Phone Number field in common. I want to create one view of format table displaying all available users and node ...
0
votes
1answer
23 views

Custom form validation is missing

I have a registration form : <div class="register-error" id="register-error">{{ form.status_messages_user_register_form }}</div> <div class="row"> <div class="col-sm-6">{{ ...
0
votes
0answers
21 views

JS not completely working for anonymous

some of my jquery not isn't working when the user is not connected, I have this : Drupal.behaviors.basic = { attach: function (context, settings) { (function($) { $(window)....
0
votes
0answers
15 views

Why is my user getting logged out before reaching hook_file_download()

I'm having problems where my logged-in users are trying to access a file (in private file area) but when they get to the hook_file_download() function of my module, they are coming through as user 0, ...
-2
votes
2answers
38 views

Bulk user creation

We manually create users via the Acquia Cloud Sites Factory. I want to create a script that bulk creates users at one time using a .csv file with just username, email, and password. I know I can use ...
0
votes
1answer
50 views

How do I check if a user may access a given route?

I am trying to render a link from a Url object and verify the user actually has access to that URL, like when viewing a node. For some reason, this always returns FALSE, although the node is ...
0
votes
1answer
37 views

How do I get the current language in custom user edit Twig file? [duplicate]

I have a custom user profile edit twig file.How can i check current language code in user twig file in drupal8?
0
votes
1answer
11 views

Drupal8 Oaut2 add a grant type “password” to client

I work on Drupal8 project and created Rest API, everything works fine until I want to add Oauth2 when I try to get a token I got an invalid grant type error. This is the error code: { "error": "...
0
votes
1answer
23 views

Register form breaks after changing submit button value with jQuery

I need to change the submit button value (text) based on the selection made in a certain register form field. I accomplished this by using jQuery: (function ($) { $(function() { $("#edit-field-...
0
votes
0answers
17 views

User download history

I'd like to use Group (NOT Organic Group) module in a Drupal8 setup, hoping to create a permission system so that a certain group of users can access and download pdf (residing in private folder) Is ...
0
votes
0answers
16 views

Rules to remove user from role on node publish

I have tried the following: Event: updating an existing content condition: NOT node-unchanged published remove user role (I'm stuck here) The last item is my problem. There is no user reference in ...
0
votes
1answer
20 views

Controlling access to documents for specific users

I need customers to be able to access certain documents (PDFs mainly) specifically for them (they contain sensitive information). The document information is setup in nodes. I have looked at a lot ...
0
votes
1answer
23 views

Check if the site allows new user registration

In Drupal 7, on my frontpage custom template, i want to show a text if the site is allowing new users to register. Any clues? Thanks
0
votes
0answers
12 views

How can I disable email verification for new accounts for checkouts only?

My site is using email verification required for new accounts but I'd like to disable this requirement for registrations occurring during commerce checkouts (for obvious usability reasons) Currently, ...
0
votes
2answers
40 views

Query for email address already existing

I want to customise registration form action in my drupal8 site.I want to check email address is already existing.I have tried with different queries.But not worked.Can anyone to help me to solve this ...
-1
votes
0answers
11 views

How to configure Drupal Commons Activity Streams

I'm wondering what is the best way to "hack" into the Drupal-Commons Activity-Streams. As an example, I'd like to remove the profile-pictures from the user-specific-activity stream.. (to provide each ...
1
vote
1answer
29 views

How to restrict users of other roles from seeing the site administrator details?

I have created a role called "Site Admin" and created a user with that role. When i log in with that username. "People" menu is showing in toolbar only when we give "adminster user" permissions to ...
-3
votes
0answers
39 views

Under what conditions will \Drupal::currentUser()->getRoles() return “anonymous”?

I have an external service that passes a basic auth header to a controller in Drupal, which uses \Drupal::currentUser()->getRoles() to pass back the roles. Some users are reporting that they are ...
0
votes
2answers
19 views

Rewrite results for user picture to except tokens

I have a user role called "Residents" in D7, and created a view the show profile information. I want to add colorbox to the User Picture, but there is only one token available [picture]. How do I add ...
-1
votes
1answer
33 views

How to get Profile fields to user edit form?

I am using profile module and make two fields say "Phone Number" and Address". These two fields are show on user registration form /user/register but not show on user edit form /user/{user_id}/edit . ...
2
votes
1answer
63 views

Direct photo and name to Profile page

Update#2 Actual user name is superuser but with kint, its still reading the admin id and displayname. This also happens to the URL, its reading the admin's profile link profile/1 I tried to dig into ...
0
votes
3answers
76 views

How to check whether a username already exists?

I had created a controller where I can create a new user programmitically by the following code. $user = User::create(); //Mandatory settings $user->setPassword($password); $...
1
vote
0answers
24 views

Is it possible to cancel the creation of user without triggering an error?

I have a problem with account creation spam, in which a bot or other bad actor tries to create accounts using somebody elses email address. The owner of the email address flags the verification email ...
0
votes
0answers
21 views

Different registration pages with different fields for different user roles

I want to make different registration pages with different fields for the roles. I've used Profile and created different profiles types with different fields for each one and included it in the ...
0
votes
0answers
27 views

Access denied for all users, access log shows NULL uid

My Drupal 7 site has been up and running for a couple years without issue. I went to log in as admin today to check for security updates and had the following experience: First browse to the page (as ...
0
votes
0answers
15 views

Enable a user to see their own email address in a view without assigning 'Administer users' permissions

I have created a view that displays the currently logged in user's email address. However, I'm finding that the email is only visible to users who have the 'Administer users' permission. How can I ...
0
votes
0answers
6 views

Setting up notifications about the modification of a parent item in a basic page

If a contributor changes the parent item from menu settings of a basic page, I want to get an automated notification. Is there a way to set up a notification system if one of the contributors change ...
0
votes
2answers
34 views

Permission issues with Custom Content Entity exposed to REST API

I hope it's not a duplicate entry. I've recently created my Custom Content Entity within a Custom module and I'm currently having trouble with permissions. (Please see permissions below) The ...
0
votes
1answer
38 views

Views filter handler for user authored from Custom Form

How can I make a custom views filter handler to filter a list of users which the current user created? For example: The user adds members to the site a view will show only the members that the user ...
-3
votes
0answers
31 views

Print current user in page.twig.html

How to print current user name in drupal 8 in page.twig.html ? or print profile photo ? What do I put in template_preprocess_page() ?
0
votes
0answers
10 views

Registered users create lists and share that list for D8

I have set up flags so that registered users can flag a node and then create a list on their saved flags page. The problem is, this is for their eyes only. I want two things, for them to be able to ...
3
votes
3answers
63 views

When to use a new field on the user account or a custom table and when use user.data service?

Is there any rule when to use a new field in the user account for storing information and when to use the user.data service? My initial approach was: When the information should be editable either by ...
0
votes
0answers
29 views

Access Private Tempstore for anonymous user after registration

I try to use the private temp store for anonmyous users, and store information, here only a unique id, but afterwards more information of course. This works. When the user registers the information ...
1
vote
0answers
28 views

Permission to People but not Account Settings

I am looking to give a user the permission to manage users (add/edit/remove) on the page /admin/people. But I do not want them to be able to access the Account Settings page on /admin/config/people/...
1
vote
1answer
29 views

No welcome email sent when users register via profile2 registration path

I am using profile2 registration path for two different types of roles. The roles are auto-assigned when users register via one of the paths. I have used mail logger to check and the emails are not ...
0
votes
0answers
29 views

My theme's page.tpl.php has made my user login form disappear at mysite.com/user

I was able to create page--user--login.tpl.php with this code in it: <div class="user-login-links"> <span class="password-link"><a href="/user/password">Forget your password?</a&...
0
votes
0answers
31 views

How to create a generic page for each user without a custom module?

I'm looking for a way to create one basic page for all user's website (instead of creating one basic page by user). This basic page must manage an url with a variable component. When I will create ...
1
vote
1answer
37 views

How to migrate users and keep their IDs unchanged?

I'm trying to use migrate_d2d, via the UI, to migrate a site from D6 to D7. I need to preserve user UID's in the migration. I'm finding the documentation confusing.. Given this in the UI... What ...
-1
votes
1answer
19 views

How can I set page specific user view access by user role?

I need to be able to restrict access to specific pages based on user role, I heard that nodeaccess could do that, but I haven't been able to figure out how to do that with it, can you set page ...
0
votes
0answers
24 views

Show field data on profile

I have created a text field in Home » Administration » Configuration » People » Account settings and I want the data entered in that text field to be shown on the users profile page. Drupals ...
0
votes
1answer
22 views

Change the location of Edit Profile

I am using Profile 2. When the user clicks the 'Edit My Profile' tab, I would like its destination to be: /user/175/edit/about-you Where about-you is a Profile2 type. How do I change the path of ...