Avoid retrieving user suggestions if Researcher profiles are disabled#3948
Conversation
tdonohue
left a comment
There was a problem hiding this comment.
👍 Thanks @toniprieto ! I've verified this fixes the error & still works when Researcher Profiles are also enabled. I don't have a better way of performing this check. I don't see any corresponding /server/api/authz/features endpoint for the Suggestions feature. So, it appears we need to check the existence of researcher-profile.entity-type as you are doing.
I'm going to give others (especially @atarix83 ) about 24 hours to give this a quick glance. After that, I'll merge it. We can always revisit it to clean it up later as necessary, if we find a better solution.
|
NOTE TO SELF: This only needs to be ported to 8.x, because the "suggestions" feature didn't exist in 7.x. This issue doesn't appear to impact 7.x |
|
Successfully created backport PR for |
References
Description
Modification of the effects used by the suggestion feature to avoid retrieving user suggestions if Researcher profiles are disabled.
Instructions for Reviewers
Comment out the key :
And verify that no error appears in the console when a user authenticates or if the page is reloaded with an authenticated user.
Then, uncomment the key and check that suggestions are still being retrieved. (I'm not using the suggestion feature, I just tested that the function retrieving suggestions is called correctly.)
Checklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.