-
-
Notifications
You must be signed in to change notification settings - Fork 566
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
Control panel breaks when avatar is added to logged in user #11364
Comments
Update: after more debugging and die dumping, I've found that the error seems to occur in the blueprint() function on the user (found in the UserRepository class in statamic/cms/src/Auth/UserRepository), namely in USerBlueprintFound::dispatch($blueprint). The dispatch function, located in statamic/cms/src/Events/Event.php, returns event($event), and it is here that it seems to break. If I comment out the return statement, I can access the control panel as before, even with my user that has an avatar. Everything looks and works like it should. When logging $event::class, almost 500 identical rows (local.DEBUG: Statamic\Events\AssetContainerBlueprintFound ) are printed to my logs file, which could indicate that the event is triggered too many times? |
Do you see any errors in your log file when the CP breaks? Can you try uninstalling |
@duncanmcclean if I remove tdwesten/statamic-builder, the control panel is accessible again. The blueprints and collections are gone (since they were created with statamic-builder), and the avatar field on users is gone as well (since the UserBlueprint was also added with statamic-builder). I guess the issue has to do with some clash between the user blueprints from statamic and statamic-builder then? And no, no errors appear in the log file when the control panel breaks. |
Yes, it might be best bringing it up with the addon developer. We don't typically recommend that addons re-bind internal Statamic classes. |
Thanks for your replies @duncanmcclean ! |
@duncanmcclean just to give an update. This wasn't because of statamic-builder, it's the bug that is trying to get fixed in #11390 between statamic and telescope that caused it. |
Bug description
I've encountered a strange problem that breaks the control panel. My users table has an avatar field and I've added an assets field to the UserBlueprint where it is possible to upload or choose an image. I can add and remove avatars for users and they appear next to the user name in the Users section of the control panel, as expected. If I however add an avatar to the user with which I am currently logged in, after I've saved the changes, the control panel breaks and I get "This page isn't working - localhost didn't send any data". There are no other error messages, nothing in the console and the error logs in my project don't receive any new errors either. I've restarted everything, cleared cache and cookies, which logs the user out and I am presented with the login form. I can login with another user and see the avatar next to my user name, but if I login with a user that has an avatar the control panel breaks. If I remove the avatar from the database table, everything works normally again.
Remaining backend and frontend of the project works as it should. I can access the user avatars in my frontend (I'm displaying it next to the article author name). I've tried debugging by dumping in various files and functions - for example in the HasAvatar trait, where it seems to find the data it needs. I've also tried to empty the dashboard view completely, save for a simple p tag (thinking there was some issue with how the user data is fetched and presented on the dashboard), which changed nothing.
Since the avatars of users are displayed in the dashboard and are accessible in the frontend, I'm assuming that there is nothing wrong with how the data is saved and retrieved. But I'm at a total loss as to why the control panel breaks. Has anyone had a similar issue?
How to reproduce
Logs
No response
Environment
Installation
Existing Laravel app
Additional details
I'm using tdwesten/statamic-builder for creating blueprints, collections etc. The frontend is a separate project.
The text was updated successfully, but these errors were encountered: