Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to a member function isAdmin() on null” when trying to install the Panel #1909

Closed
texnixe opened this issue Jul 9, 2019 · 4 comments

Comments

3 participants
@texnixe
Copy link

commented Jul 9, 2019

Describe the bug
When trying to install the first Panel user, after clicking on "Install", the above mentioned error message appears and it is not possible to install the first user.

To Reproduce
Steps to reproduce the behavior:

  1. Download a fresh 3.2.1 Starterkit
  2. Go to yourdomain.com/panel
  3. Enter credentials for the first user
  4. Click on "Install"
  5. See error

It's caused in this line:

 if ($role === 'admin' && $user->kirby()->user()->isAdmin() === false) {

Should probably be

 if ($role === 'admin' && $user->isAdmin() === false) {

Expected behavior
The first user should be installed without error.

Screenshots
If applicable, add screenshots to help explain your problem.

Kirby Version
3.2.1

Console output

code: 500

exception: "Error"

file: "/Users/sonja/public_html/321/kirby/src/Cms/UserRules.php"

line: 108

message: "Call to a member function isAdmin() on null"

route: "system/install"

status: "error"

Desktop (please complete the following information):

  • macOS
  • Safari

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Log in is possible after throwing in a user account from another project.

@GiantCrocodile

This comment has been minimized.

Copy link

commented Jul 9, 2019

Tried to reinstall my plainkit with v3.2.1 and got the same error.

Tested your fix and it worked in file kirby/src/Cms/UserRules.php.

@bastianallgeier

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

I'm really sorry for this :( That's my fault.
The fix looks a bit different though. I just created a new branch for it: https://github.com/getkirby/kirby/tree/release/3.2.2

Please give it a try and let me know if this fixes it for you as well.
We will launch it later today.

@bastianallgeier bastianallgeier modified the milestones: 3.2.1, 3.2.2 Jul 10, 2019

@GiantCrocodile

This comment has been minimized.

Copy link

commented Jul 10, 2019

I replaced the lines with the new code from the branch and deleted my previously created user. After accessing the panel again, I was successfully able to create a new user. Seems to work!

@bastianallgeier

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.