I applied the latest patch from comment #25 π Autologout can log out out from other tabs/windows Active and ran into a bug.
The issue: If I have multiple tabs open, and go from being active to being inactive on the same tab, the autologout / alert does not get triggered at all. No JS errors either.
It works correctly in the following scenarios:
1. Starting completely fresh and opening up multiple tabs and remaining INACTIVE from the start would trigger the logout alert correctly.
2. Starting completely fresh and opening up multiple tabs and being ACTIVE in one of the tabs would NOT trigger a log out on the INACTIVE tab(s), which is the correct behavior.
Let me know if I'm missing something. Thank you!
After installing 5.0.1 and running an accessibility check (using axe DevTools Chrome extension) on a page that uses Chosen, the following error is flagged with the following solve:
Elements must only use permitted ARIA attributes. Ensure ARIA attributes are not prohibited for an element's role
Element Location: #edit_affiliation_chosen > .chosen-single > div[aria-label="Show options"]
<div aria-label="Show options"><b aria-hidden="true"></b></div>
To solve this problem, you need to fix the following: aria-label
attribute cannot be used on a div with no valid role attribute.
A possible solution could be to change the code to <div aria-label="Show options" role="listbox">
with a role added. Doing this and running the scan again eliminates the error.
This thread is very useful, so I thought it'd be worth coming back here to update for Drupal 10. Based on the addition made here:
https://www.drupal.org/node/3002289 β
which introduces hasRole()
// If current user is an administrator, do something
if (\Drupal::currentUser()->hasRole('administrator')) {
// Do something
}
For my uses, I needed to hide a button for all users who were NOT administrators. This is what worked for me:
if (!\Drupal::currentUser()->hasRole('administrator')) {
$form['actions']['revert']['#access'] = FALSE;
}
I also scoured the Internet for a solution to this, because I ran into the exact same issue recently. Your solution was very helpful, especially when you noted to add "Title" referencing the "Relationship." In my case I had a "Parent Name" with a Field Type set to an entity reference of type "Group."
In my specific View, the steps I followed were:
1. Added a "Relationship" of "field_name_parent: Group"
2. Added "Title" to the filter criteria with the "Relationship" set to "field_name_parent: Group", and I was able to set the "Operator" to "Contains"
This allowed me to filter results for "Parent Name" correctly. Thanks again!
Hello. When would this fix go into an office stable release? We are running into the same issue on our project. Thank you.