Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Error on login page

Started by Muut Archive 10 years ago · 9 replies · 483 views
10 years ago

On example.com/admin one person gets an error, no matter which browser or tablet.
It works fine for me and others. Don't see what's causing it.

Error in grav.log:

[2016-01-25 15:18:11] grav.CRITICAL: Invalid argument supplied for foreach() - Trace: #0 /home/example/public_html/system/src/Grav/Common/User/User.php(159): Whoops\Run->handleError(2, 'Invalid argumen...', '/home/exam...', 159, Array) #1 /home/example/public_html/user/plugins/login/login.php(426): Grav\Common\User\User->authorize('admin.login') #2 [internal function]: Grav\Plugin\LoginPlugin->authorizePage(Object(RocketTheme\Toolbox\Even t\Event), 'onPageInitializ...', Object(RocketTheme\Toolbox\Event\EventDispatcher)) #3 /home/example/public_html/vendor/symfony/event-dispatcher/EventDispatc her.php(181): call_user_func(Array, Object(RocketTheme\Toolbox\Event\Event), 'onPageInitializ...', Object(RocketTheme\Toolbox\Event\EventDispatcher)) #4 /home/example/public_html/vendor/symfony/event-dispatcher/EventDispatc her.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'onPageInitializ ...', Object(RocketTheme\Toolbox\Event\Event)) #5 /home/example/public_html/vendor/rockettheme/toolbox/Event/src/EventDi spatcher.php(23): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('onPageIni tializ...', Object(RocketTheme\Toolbox\Event\Event)) #6 /home/example/public_html/system/src/Grav/Common/Grav.php(407): RocketTheme\Toolbox\Event\EventDispatcher->dispatch('onPageInitializ.. .', NULL) #7 /home/example/public_html/system/src/Grav/Common/Grav.php(247): Grav\Common\Grav->fireEvent('onPageInitializ...') #8 /home/example/public_html/index.php(38): Grav\Common\Grav->process() #9 {main} [] []

10 years ago

Can you paste that user's configuration file? you can leave out the hashed password, name and email if you'd like

10 years ago

i believe that you may have a groups setting set incorrectly

10 years ago

Possible, did you set user/config/groups.yaml? What's its content?

10 years ago

This is the content of groups.yaml

YAML

redacteuren:
  groupname: redacteuren
  readableName: Redacteuren
  description: 'Redactie van de site'
  icon: child
  access:
    admin:
      login: true
    site:
      login: true
10 years ago

Content of username.yaml

YAML

email: i[email protected]
access:
  admin:
    login: 'true'
    super: true
  site:
    login: 'true'
fullname: 'John Doe'
title: redacteur
state: enabled
hashed_password:
###
language: en
groups: redacteuren
10 years ago

Thanks for pointing me in the right direction. Without the group rights it works. There must be a typo somewhere.

10 years ago

Ok in the user yaml, groups expects an array. Use:

YAML
groups:
  - redacteuren

I will make sure this will not be an error any more by making sure a single group works as well.

10 years ago

I now see this was in the docs, so was a suggested usage, but didn't work as expected. Already fixed in the code for the next release.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1354 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4064 9 years ago
Archive · by Muut Archive, 9 years ago
1 2951 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago