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

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

0
votes
0answers
10 views

How to display the rendered entity of the user?

When I install the Message Example submodule, it is possible to display the rendered entity of a node with the token [node-render]. How to make a user view mode? What code should I add for in ...
1
vote
1answer
11 views

Multiple 'Register an Account' Menu Links Being Automatically Created

On my Drupal 8 website, I keep getting 'Register an Account' menu links, being automatically created in the User Account Menu. After a while, I then have to manually delete around 50 or more entries ...
0
votes
0answers
19 views

User edit loads data from logged in admin instead of edited user [on hold]

I have a user edit page for admin. As an admin, when I click to edit the user, some data loads from the edited user while some data loads from my own user. For example, when I click to edit the user, ...
0
votes
1answer
34 views

Alter The User Login Form Into Multi Steps

I want to alter my default user login form into multi step. therefore I have wrote a code which I'm pasting below. but this code is not working, whenever I click on "Next" button it will return on the ...
0
votes
0answers
13 views

How to embed a login or register form inside a page content body

First of all I am new to drupal. I am looking for a solution where I can include a login or register form in the body of a page with admin-editable page content/markup flowing before and after it. ...
0
votes
0answers
17 views

Pantheon Live / Test / Dev Login Issue

I have recently inherited a Drupal 7 site on Pantheon.io. None of the admin logins that work flawlessly in the Live environment work in either Test or Dev. I have pushed/pulled code and DB between the ...
0
votes
0answers
15 views

Access checks per theme hook

I have a custom theme_hook defined in another module and used across the website. function OTHER_MODULE_theme(){ return [ 'other_module_custom_theme' => [ 'variables' => [ ...
1
vote
2answers
25 views

How to prevent Profile2 fields from loading on user registration?

I have a profile2 Profile that's named Driver. This profile has a Term reference to a vocabulary named Cities that contains over 30.000 terms. I made a custom user-register.tpl.php by declaring it in ...
0
votes
0answers
18 views

How to check Geocoder module is firing on User save?

I've been using Geocoder module, with Addressfield and Geofield modules, successfully on a site for months, but have now hit a strange problem. SETUP: The User entity contains a Geofield field ...
1
vote
1answer
42 views

Customize “Access Denied” (403) page for specific content type [closed]

I'm currently setting up a simple LMS in Drupal 8 and would like to customize the Access Denied page as follows: Anonymous users should be redirected to the Login page, when they hit a 403 error. ...
0
votes
1answer
39 views

Why does the shopping cart display the login form?

When I'm not logged in and click on the cart logo, the following page appears with the login form: /cart 1) I want the contents of the shopping cart to be displayed. 2) When I click on the "...
1
vote
2answers
30 views

How to send the emails related to the user account in HTML?

I want to send the emails related to the user account in HTML version: forgotten password new account account canceled ... If I make a copied paste of my HTML code, it does not work. /admin/config/...
4
votes
4answers
44 views

Create a webform which creates a user account

I'm looking to create a user registration form on a Drupal 8 site that has multiple clearly defined sections (possibly on separate pages). I've explored doing this with the standard Drupal ...
1
vote
1answer
31 views

How to add template suggestion for user--VIEW-MODE--ROLE.html.twig

I used hook_theme_suggestions_HOOK_alter: function MYTHEME_theme_suggestions_user_alter(&$suggestions, $vars, $hook) { // Define the view mode. $mode = $vars['elements']['#view_mode']; // ...
0
votes
1answer
21 views

How do I redirect to a certain page from user profile page

I have created a hook and redirected the users after login from the login page to a certain page. But when I go to /user/login after a successful login will redirect me to the user profile page (/...
0
votes
0answers
11 views

REST logout returns 403

I'm building a site with GatsbyJS and Drupal 8 as a backend. I can successfully login users. However, I receive this error when logging out. POST http://localhost:8888/user/logout?token=...
1
vote
1answer
24 views

How to make sure simpleSamlAuth module is working as intended?

I'm working on a Drupal site which is utilizing the simpleSAMLphp_auth module. We want users to be able to log in using their Gmail accounts, so long as they have an pre-existing Drupal account to ...
0
votes
0answers
14 views

Drupal 7 user authorization from ionic 3

I am trying to access Drupal (CMS) and Civicrm (CRM) from Ionic 3 Mobile application - using same login page So, I am trying to login to Drupal - Using BaseUrl, username and Password - Is this ...
-1
votes
0answers
15 views

Cant access site in different volume [on hold]

I am setting up a drupal(7.59) site in centOS 6 with apache. I want my site's files to be in a separate disk volume which has been mounted to a separate location(/opt/mountpoint). I have tried ...
-1
votes
2answers
23 views

How to see unpublishes content types In a view?

I have a view which displays a list of unpublished content type "Nascholingen". I use D8 + varbase + content access module In super admin all goes good. I added a new rol called "lid". Logged in ...
1
vote
1answer
37 views

Programmatically Create an Array of User Objects and Print in Twig Template

MYMODULE.module: function MYMODULE_preprocess_node(&$variables) { if ($variables['node']->bundle() == 'content_type') { $currentUserUID = \Drupal::currentUser()->id(); ...
1
vote
2answers
27 views

How to do user relations, and User editing only their content?

Doing Drupal 8.6 is hard (I come from Laravel and Wordpress world). I manage to do by myself OAuth token authentication with Vue, but I stopped on User relations and content-type. I know that where ...
0
votes
0answers
15 views

How to expose the role of an entity reference user?

Using Drupal 8.5.x I have a content type with a list of user as Entity Reference. The reference type is connected to a view. The entity reference lists the selected users, both Primary and Secondary ...
1
vote
3answers
251 views

How do I redirect after saving the user account with $user->save()?

How can I redirect users in a custom module after saving a user account with $user->save()? It always goes to the user profile after saving and I want to redirect to a custom page. function ...
0
votes
2answers
20 views

Block above content should be simple however

I have a site where they are wanting to have a block above various pages without having a ton of blocks on the blocks layout page. For example they want a block above the login form on the user login ...
2
votes
2answers
42 views

How limit access to a paragraph type by role, like it is for content types?

The permissions page at /admin/people/permissions provides very fine grain control over which actions people can do with specific content types. How can I add all paragraph types under this ...
1
vote
1answer
36 views

How to create user programatically if not exist?

I am using this code to create user. if(user_validate_name('czxc') != ""){ $user = User::create([ 'name' =>'czxc', 'mail' => 'user@gmail....
0
votes
2answers
29 views

How to give a roll only access to add a certain content type?

In D8: I have a content type call fooCT. I have a role called: "fooRole" I give fooRole the following permissions: fooCT: create fooCT use simple editor So the checkbox: View published content is ...
0
votes
0answers
24 views

Field Groups conditional/visibility

i have a quite complex user-registration form. To have a better overview about all the things to fill out, I used the "Tab" field group to sort them. For example I have the tab "personal Data". When ...
0
votes
0answers
29 views

403 forbidden on OPTIONS preflight request in VueJS

I'm trying to login to Drupal with the VueJS Axios library like so: export const HTTP = axios.create({ baseURL: 'https://admin.portal.dev/', headers: { 'Accept': 'application/json', ...
1
vote
0answers
17 views

Add permission to existing role in custom module using configuration

Permissions may be added to existing roles programatically as described in this answer. However, I would like to put that into configuration. I can create a role calling king by putting user.role....
0
votes
0answers
12 views

Any possibilities of more than one user having same email address?

So this might be a premature question. Can i have a user with same email ID who can access different domains with different role for each domain? I will login as a admin and create a user say, ...
0
votes
0answers
16 views

Cannot modify headers when adding a new user

I periodically get an error in my drupal log that I believe is generated when a user is modifying or creating an account. Today, when adding an account as an admin, I finally saw it on the screen: ...
0
votes
0answers
49 views

Get Current User in Views

So I am building a website (of course using drupal), and have a table in views. Now, I also have installed on the website Views PHP. In this table, I have a names column. In the Names column in views, ...
-1
votes
0answers
27 views

Drush error when running drush user-cancel

I'm trying to delete all users without a role, using a command mentioned here: I'm using Drupal 7.59 and Drush 8.0.5. I ran this command in the root Drupal folder: drush user-cancel `drush sqlq --db-...
0
votes
1answer
12 views

Update user profile picture using entity_metadata_wrapper

I am trying to update the user profile picture using entity_metadata_wrapper. But I am getting "Unknown data property picture." error. When I check the user property info, I cant see the ...
0
votes
1answer
30 views

Display User Author Details in Block UserProfile

I am looking to display my own block on user profile page. The block will to display the username of the user whom profile we are viewing. I went ahead and created a view, show users, block. Added ...
0
votes
0answers
18 views

Anonymous users skip comment approval but they shouldn't

In my drupal 8.6.1 news blog anonymous users can skip comment approval althouth permissions are set to not skip. I rebuilt the permissions but nothing changed. Also in comments page I see that some ...
1
vote
1answer
33 views

Change the default “Create new account” title on the User registration page

I would like the change the default title (and probably also the meta title) of the User registration page, currently "Create new account". I tried the Static and Dynamic page title method described ...
1
vote
1answer
45 views

Which permission should I use for a role to see a shortcut to Custom Block Library?

I have a custom block that is a site-wide announcement. I have a role, "Announcement Editor", for those people who I want to edit that message. Most of our users have restricted permissions, and don'...
1
vote
1answer
15 views

Group users and display the group on the profile page

How can I create a group/role/taxonomy term or anything else to group specific users ? I also want to display the "group/role/taxonomy term or anything else" on the users profile. For example: I go ...
0
votes
0answers
30 views

Registration via Webform

i'm trying out different ways for users to register at my website. The basic Drupal-Fields and Options don't fit my needs. I need fields to pop up when the field above is filled, accordions and stuff ...
0
votes
1answer
27 views

user_role_revoke_permissions() for administrator

I am using EU Cookie Compliance module. During module installation, permission has been set to admin also. I need to revoke that permission which is assigned to Admin as cookie pop-up is coming-up ...
1
vote
1answer
13 views

“Structure->Block” showing when permission is not given to user

I have user role 'Admin', who can see 'taxonomy terms' under 'Structure', I have given same permission but it is showing 'Block' and 'Views' too. Is there any workaround in Drupal 8? Any help would ...
0
votes
1answer
35 views

How to programmatically reset user password

I'm trying to create a custom module for resetting the user's password. In the following block of code I'm attempting to get the password in hash form: $pass='User123@'; $autoloader =require_once(...
0
votes
1answer
35 views

Programatically create user that needs admin aproval

When creating a new user with user_save, it seems to get the "approved" role automatically, even though I pass an empty array to $user->roles. How can I force the programatically created user to ...
1
vote
1answer
40 views

Unpublished file still downloadable

I have a file attached to a node via a link. The node is published but the file is unpublished. The link on the node points to the file /sites/default/files/file.txt The file is still downloadable by ...
0
votes
0answers
33 views

How to copy the user account 'picture' , using Rules

Drupal 7, File Field Rules module. How can I select the 'picture' from a user's account, as a source to copy from? I am trying to copy it to another image field in the same user's image gallery. ...
0
votes
1answer
39 views

\Drupal::currentUser() returns admin account info instead of logged in user

The following function resides in a .module file: function user_menu_avatar_menu_links_discovered_alter(&$links) { $user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id()); ...
-3
votes
1answer
36 views

Style of User login Page [closed]

I started to create my own homepage with a theme. Now i want to customize the user login-page. I can't find the user/login, user/register and user/edit pages in the context area of the administration ...