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

Issue #1848 EmitFileEvent.php: Call to undefined function getFileUri() #838

Merged
merged 1 commit into from
Jun 30, 2021

Conversation

alxp
Copy link

@alxp alxp commented Jun 18, 2021

Github Issue: EmitFileEvent.php: Call to undefined function getFileUri()

What does this Pull Request do?

Adds an explicit check before calling a function that can be on a Media or File entity type.

What's new?

The event generation that happens after a context reaction to index an external file in fedora accepts entity types that are either Media or File objects. The generateData function assumes that the object is always a File when it checks to make sure the fedora:// URI does not have one-too-many slashes in it.

This change simply explicitly checks if a getFileUri() function exists before calling it.

How should this be tested?

Follow the steps to reproduce in the linked GitHub issue, namely: Create a Media such as Image in a fresh Islandora install.

Check that all derivatives are generated, and look in the Watchdog log to ensure that the error that the getFileUri() function does not exist is no longer reported.

, @Islandora/8-x-committers

Explicitly check for function before it is called.
Copy link

@dannylamb dannylamb left a comment

Choose a reason for hiding this comment

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

This patches the hole so lets bring it in. I did some more analysis and it looks like we can delete the context for Fedora Files, which does indeed use EmitFileEvent to get stuff indexed in Gemini. I don't think that's what's triggering the whitescreen here, but it's definitely related and some cruft to clean up in islandora_defaults.

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 this pull request may close these issues.

2 participants