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

Default fallback image now modifiable via add_file_fallback_image fun… #916

Merged
merged 3 commits into from
Feb 22, 2021
Merged

Default fallback image now modifiable via add_file_fallback_image fun… #916

merged 3 commits into from
Feb 22, 2021

Conversation

DBinaghi
Copy link
Contributor

@DBinaghi DBinaghi commented Apr 19, 2020

See #913

Default fallback image was not programmaticaly modifiable because of it using a constant; I've solved the problem by creating a new entry for the $_fallbackImages array.

…ction

See #913

Default fallback image was not programmaticaly modifiable because of it using a constant; I've solved the problem by creating a new entry for the $_fallbackImages array.
DBinaghi added a commit to DBinaghi/plugin-MoreMediaTypes that referenced this pull request Apr 19, 2020
To be able to apply a custom standard fallback image, one needs a change in application/views/helpers/FileMarkup.php file; see omeka/Omeka#916 for more info
@zerocrates
Copy link
Member

This is a pretty reasonable solution to your issue, but I don't love the "generic" key that's being used here... maybe an asterisk * would be better?

I also think just for any possible other code that might have referenced it, it's best to leave the GENERIC_FALLBACK_IMAGE constant there.

@DBinaghi
Copy link
Contributor Author

DBinaghi commented May 8, 2020

I see no problem in using "*" instead of "generic" (I'd kept "generic" as that was the key used before, I thought for some reasons somebody I had gone for that).
And also in keeping the constant GENERIC_FALLBACK_IMAGE, it'd hurt nobody. In fact, it can be used even here, just by moving its definition before the definition of the other fallback images.

And changed key for "fallback-file.png" from "generic" to "*"
@zerocrates
Copy link
Member

To refer to a class constant within the same class, you need to use self::, so self::GENERIC_FALLBACK_IMAGE. The way you have it will cause a warning (and if you're not overriding that entry with a plugin, an error).

The line defining the constant is fine, but as a matter of style, could you move it to the top of the class, above all the static properties?

@zerocrates zerocrates merged commit 1a57148 into omeka:master Feb 22, 2021
@DBinaghi DBinaghi deleted the patch-8 branch February 22, 2021 23:47
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