Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

🧹 Reindex the child work after save #332

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/listeners/iiif_print/listener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def on_object_membership_updated(event)
return unless object.respond_to?(:iiif_print_config?) && object.iiif_print_config?

Hyrax.custom_queries.find_child_works(resource: object).each do |child_work|
unless child_work.is_child
child_work.is_child = true
Hyrax.persister.save(resource: child_work)
end
next if child_work.is_child
child_work.is_child = true
Hyrax.persister.save(resource: child_work)
Hyrax.index_adapter.save(resource: child_work)
end
end
end
Expand Down
Loading