I have made a start on this and will try to add patch

Issue fork userone-2883168

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joeuk31 created an issue. See original summary.

joe huggans’s picture

StatusFileSize
new613 bytes
joe huggans’s picture

joe huggans’s picture

Category: Feature request » Task
mqanneh’s picture

Status: Active » Needs work

@joeuk31

After applying this patch the user 1 account became hidden from the user overview page while a PHP error appeared.

Notice: Undefined property: Drupal\views\ViewExecutable::$options in userone_views_query_alter() (line 43 of modules/contrib/userone/userone.module).
userone_views_query_alter(Object, Object)
call_user_func_array('userone_views_query_alter', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('views_query_alter', Array) (Line: 1380)
Drupal\views\Plugin\views\query\Sql->alter(Object) (Line: 1313)
Drupal\views\ViewExecutable->build() (Line: 390)
Drupal\views\Plugin\views\display\PathPluginBase->execute() (Line: 168)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1627)
Drupal\views\ViewExecutable->executeDisplay('page_1', Array) (Line: 77)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func(Array, Array) (Line: 378)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 108)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 67)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 44)
Drupal\services\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

This is because the $view object doesn't have the options object.

mqanneh’s picture

Title: Admin user not hidden from 'admin/people' page/view » Hide user 1 from user overview page
mqanneh’s picture

Category: Task » Feature request
Status: Needs work » Needs review
StatusFileSize
new1.09 KB
joe huggans’s picture

Category: Feature request » Task
Status: Needs review » Needs work

Should use 0 for group i.e default instead?

AstonVictor made their first commit to this issue’s fork.

astonvictor’s picture

Status: Needs work » Fixed

Created and merged a new MR.

Implemented a new views query alter hook to add a new condition by user id for all views that use the users table.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.