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

NPE in metadata editor when MediaView is not configured in project #5532

Closed
solth opened this issue Feb 7, 2023 · 2 comments
Closed

NPE in metadata editor when MediaView is not configured in project #5532

solth opened this issue Feb 7, 2023 · 2 comments
Labels

Comments

@solth
Copy link
Member

solth commented Feb 7, 2023

Describe the bug
#5405 introduced an improvement where the first medium of a selected structure element would be automatically shown in the gallery of the metadata editor. However, this revealed a bug in the system where a Null Pointer Exception would be thrown when the obligatory MediaView folder is not configured in a project settings and the user opened a process of that project in the metadata editor with at least one medium assigned to the root element (e.g. not assigned to any other structure element).

This exception is caused by the hidden p:graphicImage element in the file gallery.xhtml with ID mediaViewData - that is meant for storing the image to be displayed in the OpenLayers component of the gallerys detail view - not checking for a complete project configuration but instead always trying to load the mime type of said MediaView project folder configuration.

To Reproduce
Steps to reproduce the behavior:

  1. Create a project where a folder is correctly configured as MediaView
  2. Create a process in that project
  3. Add at least one image to the process and save the process so that the image is assigned to the logical root node
  4. Change the project configuration and remove the configuration for the MediaView folder
  5. Open the process in the metadata editor again
  6. Observe the NPE

Expected behavior
Either setting a MediaView folder in the project settings should be mandatory or (better) the function loading the image for the OpenLayers detail view of the metadata editor gallery should check whether the MediaView is properly configured or at least not null before trying to retrieve it's mime type. In any way, a NullPointerException should not be displayed in the circumstances described above.

Screenshots
Bildschirm­foto 2023-02-06 um 17 38 38

Release
3.6.0-SNAPSHOT

@solth solth added the bug label Feb 7, 2023
@henning-gerhardt
Copy link
Collaborator

Is this maybe related to #5099 ?

@solth
Copy link
Member Author

solth commented Feb 7, 2023

Yes, you are correct. Closing this as duplicate of #5099

@solth solth closed this as completed Feb 7, 2023
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

2 participants