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

Questions tagged [users]

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

0
votes
0answers
16 views

Kep getting “access denied” when using a “user-cancel” link

I'm developing a simple troubleshooting menu on Drupal 7 to allow users request a new password or cancel their account depending on some factor. To do so I basically call $mail = drupal_mail('user'...
0
votes
0answers
8 views

What's the best infrastructure to set permissions to user roles that controls who can see which Nodes and which Views?

I'm building a Drupal 8 website that needs pretty stringent permissions. I have already created the (4) user roles for the site, but not sure the best way to handle viewing permissions. I see that ...
3
votes
1answer
64 views

How can I show the user login block on the 403 page?

With D8, I have a node (content type: basic page) that I use as a custom 403 (access denied) page. I set this as the custom 403 page on: /admin/config/system/site-information. The path is /node/21, ...
-1
votes
1answer
16 views

User role update report

Could you let me know how to check how many users converted from one role to another for a specific period of time (for example how many changed roles from user to superuser from 01/09/2017 to 01/02/...
0
votes
0answers
10 views

What does “Field values for name must use an array structure” mean?

I am try to login via the REST API; curl --header "Content-Type: application/json" \ --header "Accept: application/json" \ --header "X-CSRF: dx3hhNKGorFI_2alL_Zqde2ZFDpefAll2JZd8kNisTA" \ ...
-2
votes
0answers
14 views

How to use Feeds to read in users?

I want to read in a CSV file from an older database of customers into my drupal site. Usually when I read in a CSV file I create a content type to hold the information, for example 'Issues'. When I ...
0
votes
0answers
15 views

Dont show results a user has no permissions to

I have created a view that list media entities that are related to the module: Groups. These documents have certain restrictions to them. Each document can get 1 of 4 permissions: Permission A ...
0
votes
0answers
33 views

Cannot Login to my website - “Website encountered an unexpected error”. Logout works fine [closed]

The moment I login to my Drupal 8.6.5 website, I get the error page. /user/logout brings back the website. I have cleared the caches using phpMyAdmin. Also tried to install Drush and use drush cr ...
0
votes
1answer
21 views

Allow editing of own content but not show 'node settings' block

Hello all and happy new year! .. I have a question that I thought would have been answered before, but could not find anything.. I want users of a certain role to be able to edit their own content ...
0
votes
1answer
26 views

Grant permission to current user at runtime in specific environment

Many Drupal contrib modules have inverse "feature flag" implementations vis-a-vis a killswitch variable added to settings.local.php to disable a feature: // Killswitch setting. $settings['...
0
votes
0answers
9 views

Print custom field in user edit form in block

Following code prints user edit form in block: function notifikacie_custom_block_info() { $blocks['user_profile'] = array( 'info' => t('User profile edit'), 'cache' => DRUPAL_NO_CACHE, )...
-1
votes
1answer
7 views

Is it possible to set a role specific value for “allow_insecure_uploads?”

I want to override the value for "allow_insecure_uploads" which is in system.file config, but only for specific roles. Am I going to need to do this in a module / does one already exist?
0
votes
1answer
15 views

Override site's registration restriction on accepting invite

We have a custom module that uses the invite module to send invitation to non users. Our site is set to allow registration only by administrator to avoid spam. When the invitees accept the invite they ...
0
votes
0answers
29 views

Embed user edit form in a block

I am trying to embed current user edit form in block. Actually I want just to embed some of the newly added fields. I tried to follow this code: Embed some user profile fields in a block form But I ...
1
vote
1answer
78 views

How to programmatically update a user role name

I would like to update role name programmatically in Drupal 7. Does Drupal provide its own functions to do that, or do we need to query the database and update the name manually? Please note that ...
0
votes
0answers
7 views

How to keep billing profile in previous order even when the billing profile is deleted from profiles?

When I delete a billing profile , Drupal is not blocking me to delete eventhough when that profile is attached to an order. we want to keep previous order's billing profile as it is even though when ...
0
votes
1answer
23 views

When the admin changes(Add/Remove) roles of the user, how to get assigned and removed roles of that user?

There are more than 20 user roles(Editor,approver,new admin..) in the project. Whenever the admin assign/delete the role to user then the user should be notified with email. Email should say Hey ...
0
votes
0answers
25 views

How can I get term id or term name on user profile page

I have a vocabulary(lessons) with terms as math,art,chemistry etc.. These terms are on user page in my lesson field. For example: My Lessons: Math,Geography,Art Scenario: I'm gonna use linked field ...
1
vote
0answers
24 views

How to store all saved values of a field on User entity?

We plan to store a string as a field on a user account page. This is easy to do, but requirement is also to be able to track value changes of the field. Based on my restricted knowledge in Drupal, ...
0
votes
0answers
37 views

Displaying same username for all users with a specific role as comment author

I need to display the same username for users of a specific role as comment author. I have a Role 'Board Moderator'. When users with this role are commenting, a uniform name 'OneUserNameForAll' ...
2
votes
1answer
36 views

How to change permissions to a role when a content is set as published

I have been working with Drupal 8 and need help: I have a News content type, and an Editor role type. This Editor role can view/edit/delete his own content. I want that Editor roles can't edit/delete ...
0
votes
1answer
16 views

how to display data in view for specific content base on permission

I want to create the view where content of specific type will be visible according to given permission for current user's role. For Example:I have created a role and given it the permission for ...
0
votes
0answers
38 views

Upload a folder full of files (static html and assets) to the private files folder when creating a node

I need to be able to upload a folder full of files (static html and assets) when creating a new node and then to output a link to the index.html file in the uploaded folder. They files from a ...
1
vote
1answer
27 views

header and menu is missing from Login module page--user--login.tpl.php [closed]

I am implementing Custom Login module but Header is missing... My Directory is : modules | --- module_name | --- css | --- module_name.info | ...
1
vote
0answers
40 views

How to handle validation (email along with custom user field) user registration via REST API?

I am using Drupal 8 default REST API end points for user registration and login services as per link below provided https://www.drupal.org/docs/8/core/modules/rest/javascript-and-drupal-8-restful-web-...
0
votes
2answers
108 views

Adding field collections programmatically

I'm trying to add a field collection to my user account on an event, and it seems to be being created properly, the fields are updated as expected and it parents it to the user account, however, even ...
2
votes
3answers
169 views

Show if a user is online, idle, or offline on their account page?

I want to display the status of the user on the account page. I added the following code in the theme I am using. It works, but users are never displayed offline. Why? What is wrong in the code? ...
-1
votes
0answers
14 views

Reusing logged in user fields in customer profile?

Is it possible to reuse registered users details in the Customer Profile? e.g. [current-user:display-name] in the default value. I tried this but can't get it to show in the commerce checkout - uses ...
0
votes
1answer
50 views

Sending an email to everyone with a certain role

Me: Small business owner with no coding or Drupal background who wants to learn by doing instead of hiring a developer for every small thing. Goal: I have a Drupal 7 website and would like to send ...
0
votes
0answers
17 views

How can I allow multiple accounts use the same email address? [duplicate]

I am running multiple domains off of one install with Domain module. I need to allow users the ability to have separate accounts on each. I'm pretty sure I can alter the log in fine, but don't know ...
1
vote
1answer
20 views

How to create a view to count comments per user?

I am trying to create a view with a table that shows all the users and the total number of comments that user posted in descending order. I am not sure what I am doing wrong but I spent hours on this ...
0
votes
1answer
18 views

Modify/Alter Password Policy Constraints Text

I'm looking for the easiest possible way to modify or alter the password policy constraints error text. The following is the default the users see. The password does not include enough variation to ...
-1
votes
0answers
17 views

Log in error problem going to a /user/10 which is giving me problems

When I'm trying to log into my site, support.pegwriting, I'm redirected to http://support.pegwriting.com/user/10 and I get this error message: The website encountered an unexpected error. Please ...
2
votes
2answers
36 views

How do I display an error message on a basic page when the user does not have permissions to see the nested view inside the basic page?

I have a basic page, and inside of that basic page I have a view "newsletters". The view "newsletters" has permissions set on it based on role, so only admin and subscribers can see it. How can I ...
0
votes
1answer
18 views

Access_Callback problem

From time to time (and anytime after I run "drush cc all") my custom module with an access callback returns an 'access denied' error for Admins when they attempt to edit a user. I can solve this issue ...
0
votes
1answer
18 views

Programmatically / by Rules, remove reference of a deleted user from contents created by that user.

A user [content_editor] got deleted and the content created by this user is referring to anonymous user. While an administrator is editing that content, administrator is receiving user doesn't exist. ...
1
vote
2answers
37 views

User added with Drush not working

So, I have to work on a D8 site I don't have a user account for. So, when I brought the code and database over to my local environment, I thought this would be an easy fix for drush. My local dev ...
2
votes
0answers
26 views

Working with hook_node_access_grants

I am currently working with Permission by Term to set simple access control on two node types with terms. As noted here, I believe I found a bug where the access record isn't written the first time ...
2
votes
2answers
99 views

How to programmatically add custom markup to every displayed user name

Drupal 8.x I am currently using hook_preprocess_user(). I would like to alter the username to add some custom markup to every username. MYMODULE.module: function MYMODULE_preprocess_user(&$...
1
vote
1answer
118 views

How to display the status of the user?

I created a TWIG template for the "Teaser" view of the user account. I want to display a logo and change its color according to the status of the user : When the user is logged in <i class="user-...
0
votes
1answer
19 views

Is it possible to use drush migrate-import to import custom fields?

I am trying to migrate a Drupal 7 site to Drupal 8 on a new server I have copied the db so it can be used locally. I have run the drush migrate command and migrate-status shows a bunch of things that ...
-1
votes
0answers
28 views

Users created from back-end doesn't trigger Welcome email

For some reason any user that is created by an authenticated user on my site, doesn't receive a welcome email...even when the Notify user of new account checkbox is checked. After the user is ...
-1
votes
0answers
37 views

Rule to update or set value of a user custom field when creating a new node of a specific type

title just saying everything :) I need to a Rule that sets a value of users custom field (ex. field_custom) WHEN a new node of type (ex. page) is created/saved. For me it looks like I can only access ...
2
votes
2answers
48 views

Programatically assigning multiple user role ?

I am trying to assign multiple role while creating a user programatically. I am successfully creating a user and assigning one role using below code $user = \Drupal\user\Entity\User::create(); // ...
0
votes
1answer
10 views

After calling drupal_flush_all_caches, menu items with access callback TRUE are giving access denied error

I was building a custom module that affected the front page and I found myself having to go clear the caches for it to take effect. So as part of the code, I put in drupal_flush_all_caches(). After I ...
0
votes
1answer
25 views

How to make role field on approval in the Edit Profile page by Admin

This website has over 1000 users with different profiles. Each user choose their profile on registration. On their Edit Profile page, the authenticated users can change or add more profiles to ...
0
votes
0answers
24 views

How to specify a condition if the store is not store_pro?

I created a custom module. If the owner of the current store does not have the marchand_premium role, the add to cart button is overwritten. I want to add another condition : If the store is not ...
0
votes
0answers
25 views

Is exposing the UID a security issue?

I noticed that the UID of users is exposed in the HTML code of a page on my site that authenticated users can access. Is it a problem if authenticated users with "view user profiles" permission are ...
1
vote
1answer
16 views

How do I create a block only for the user “owning” the profile page?

I made so the logged in user have a recap of their last comments/added node on their profile with a view. As I am making the profile page public, I need to be able to hide those blocks from others ...
0
votes
1answer
25 views

How to display the user's url in a template?

I created a template user-comment.html.twig to customize the rendering of the comments author. I can not display the user account url: user.url does not work. How to display the user's url in a ...