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

The "(admin page)" link on the community admin profile page is broken #1834

Closed
defnull opened this issue Feb 14, 2021 · 3 comments · May be fixed by #1826
Closed

The "(admin page)" link on the community admin profile page is broken #1834

defnull opened this issue Feb 14, 2021 · 3 comments · May be fixed by #1826
Assignees

Comments

@defnull
Copy link

defnull commented Feb 14, 2021

The Admin role of the community "Test" (admin page) link on the profile page points to /communities/undefined/admin.

@defnull defnull changed the title The "(admin page)" link a community admin profile page is broken The "(admin page)" link on the community admin profile page is broken Feb 14, 2021
@hevp
Copy link
Member

hevp commented Feb 15, 2021

Hello, thanks for reporting.

Unfortunately I cannot replicate this. Can you retrace your steps here from creating the community to displaying the link?

And you mean the user profile page I presume?

@defnull
Copy link
Author

defnull commented Feb 15, 2021

Yes, the /user profile page.

I followed the instructions verbatim. I created a test community, added a schema, added myself to it as a community admin, and that's it.

The /api/user/ response contains roles.0.name = com:632b602f9368473aa33654aad53b931e:admin and the /api/communities/ response also lists the same role in hits.hits.0.roles.admin.name, so the server-side state is correct I guess. Adding a breakpoint in user.jsx line 134 (within communitiesListTemp.reduce()) reveals that the reduction never happens, even if communitiesListTemp.size > 1 is true. I'd guess communitiesListTemp is of wrong type. This react stuff is really hard to debug, though. Since communitiesList is now empty, the createLink() function will build a link with undefined in it, even if the name parameter is correct.

@hevp
Copy link
Member

hevp commented Feb 15, 2021

Most likely the resulting object is never properly initialized on the reduce call and therefore it has the wrong type judging by the logs.

This has been addressed, code refactored and will be included in the next release.

@hevp hevp linked a pull request Feb 15, 2021 that will close this issue
@hevp hevp self-assigned this Feb 15, 2021
@hevp hevp closed this as completed Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants