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

Avoid retrieving user suggestions if Researcher profiles are disabled #3948

Merged

Conversation

toniprieto
Copy link
Contributor

@toniprieto toniprieto commented Feb 3, 2025

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 :

researcher-profile.entity-type = Person 

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

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@tdonohue tdonohue added bug 1 APPROVAL pull request only requires a single approval to merge component: user profile error handling How errors are handled from REST API high priority port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release labels Feb 3, 2025
@tdonohue tdonohue added this to the 9.0 milestone Feb 3, 2025
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 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.

@tdonohue
Copy link
Member

tdonohue commented Feb 3, 2025

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

@tdonohue tdonohue merged commit 0649342 into DSpace:main Feb 4, 2025
15 checks passed
@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-8_x:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge bug component: user profile error handling How errors are handled from REST API high priority port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Error appears in DevTools Console ("doesn't contain the link profiles") when Researcher Profiles disabled
3 participants