-
Notifications
You must be signed in to change notification settings - Fork 5
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
DDST-416: Add fall-back logic for default image #26
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smoke testing and found one or two artifacts that need to be cleaned up.
@@ -131,8 +134,51 @@ public function addFieldValues(ItemInterface $item) { | |||
if ($generated_url) { | |||
$field->addValue($generated_url->getGeneratedUrl()); | |||
} | |||
else { | |||
// Fallback to default image if URL generation fails. | |||
$default_image_url = $this->getDefaultImageFromTaxonomy($entity, $image_style_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given what is intended, i think the $image_style_name
variable being passed in getDefaultImageFromTaxonomy
should be $config['image_style']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed the updated code.
foreach ($model_terms as $term) { | ||
if ($term instanceof Term) { | ||
// Load the media entity referenced by the field_defaultimage. | ||
$media = $term->get('field_defaultimage')->entity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The field is missing an underscore, should be field_default_image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed the updated code.
- In the Islandora Models vocabulary, select the appropriate default image for each term. | ||
|
||
This setup allows the module to associate a default thumbnail (TN) with objects that lack a specific thumbnail for any given content type. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MorganDawe updated the README file.
No description provided.