core icon indicating copy to clipboard operation
core copied to clipboard

Error when no user with ID #1 is in the database

Open evertalbers opened this issue 4 years ago • 6 comments

Trying to solve another issue (which I don't exactly remember but might have been caused by persistent cookies in my browser actually) I deleted all users and then started fresh, using bin/console bolt:add-user. The new users had ID's starting from 5 or so.

After this, when trying to get a page listing in the Bolt Backend, this error was shown (below). The error was solved by going into the database and setting the ID of one user to 1 (I picked the user with a DEVELOPER role, not sure if that made any difference). Screenshot 2022-03-06 at 21-41-22 An exception has been thrown during the rendering of a template ( Entity of type 'Bolt En

evertalbers avatar Mar 07 '22 09:03 evertalbers

I believe it's the same issue that I reported a while back: #2827

eduardomart avatar Mar 07 '22 22:03 eduardomart

@bobdenotter can I look into this? I made some comments on #2827.

abdellahrk avatar Sep 03 '22 18:09 abdellahrk

FYI I found out later that the issue is about Bolt having records with not-existing user ID's in general, not per se #1. Just in case you didn't already know this.

evertalbers avatar Sep 04 '22 13:09 evertalbers

FYI I found out later that the issue is about Bolt having records with not-existing user ID's in general, not per se #1. Just in case you didn't already know this.

can you emphasize on this? @evertalbers

abdellahrk avatar Sep 21 '22 18:09 abdellahrk

Hmm, I think we shouldn't try to ensure id 1 is present, but look at it from the other direction: Why does it break if this user isn't present? And, would it be possible to handle it more gracefully. Say, if we have a location where the backend just assumes something exists, perhaps we can make it so that we use an {% if %} of some sorts to handle it gracefully.

bobdenotter avatar Sep 29 '22 13:09 bobdenotter