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

nested metadata values with restricted visibility result in NullInjectorError: No provider for metadataValueProvider! #82

Open
saschaszott opened this issue Mar 19, 2024 · 1 comment
Labels

Comments

@saschaszott
Copy link

saschaszott commented Mar 19, 2024

Bug description

If a researcher profile has two (or more) affiliations and the security level / visibility of a start or end date is set to 2 (owner & admin only), a NullInjectorError is thrown. In this case the UI does not show page header and footer:

image

corresponding error messages in JS console:

core.mjs:7739 ERROR NullInjectorError: R3InjectorError(ItemPageModule)[metadataValueProvider -> metadataValueProvider -> metadataValueProvider -> metadataValueProvider]: 
  NullInjectorError: No provider for metadataValueProvider!
    at NullInjector.get (core.mjs:11242:1)
    at R3Injector.get (core.mjs:11409:1)
    at R3Injector.get (core.mjs:11409:1)
    at R3Injector.get (core.mjs:11409:1)
    at NgModuleRef.get (core.mjs:21973:1)
    at R3Injector.get (core.mjs:11409:1)
    at NgModuleRef.get (core.mjs:21973:1)
    at Object.get (core.mjs:21650:1)
    at lookupTokenUsingModuleInjector (core.mjs:3367:1)
    at getOrCreateInjectable (core.mjs:3479:1)
defaultErrorLogger @ core.mjs:7739

core.mjs:7739 ERROR TypeError: Cannot read properties of undefined (reading 'createComponent')
    at Object.next (themed.component.ts:107:31)
    at ConsumerObserver.next (Subscriber.js:91:1)
    at SafeSubscriber._next (Subscriber.js:60:1)
    at SafeSubscriber.next (Subscriber.js:31:1)
    at subscribe.innerSubscriber (switchMap.js:14:104)
    at OperatorSubscriber._next (OperatorSubscriber.js:13:1)
    at OperatorSubscriber.next (Subscriber.js:31:1)
    at Observable._subscribe (innerFrom.js:51:24)
    at Observable._trySubscribe (Observable.js:37:1)
    at Observable.js:31:1
defaultErrorLogger @ core.mjs:7739

core.mjs:7739 ERROR TypeError: Cannot read properties of undefined (reading 'createComponent')
    at Object.next (themed.component.ts:107:31)
    at ConsumerObserver.next (Subscriber.js:91:1)
    at SafeSubscriber._next (Subscriber.js:60:1)
    at SafeSubscriber.next (Subscriber.js:31:1)
    at subscribe.innerSubscriber (switchMap.js:14:104)
    at OperatorSubscriber._next (OperatorSubscriber.js:13:1)
    at OperatorSubscriber.next (Subscriber.js:31:1)
    at map.js:7:1
    at OperatorSubscriber._next (OperatorSubscriber.js:13:1)
    at OperatorSubscriber.next (Subscriber.js:31:1)

Please note, that it is required that the researcher profile has at least 2 affiliations, otherwise the error does not occur.

@saschaszott
Copy link
Author

this bug is fixed with PR #83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant