mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-08 14:15:35 +08:00
Fix copying and pasting TinyMCE images [SCI-7774]
This commit is contained in:
parent
8a4599bed1
commit
5f7976ce0e
1 changed files with 4 additions and 0 deletions
|
@ -35,6 +35,10 @@ class TinyMceAsset < ApplicationRecord
|
|||
end
|
||||
images.each do |image|
|
||||
image_to_update = find_by(id: Base62.decode(image))
|
||||
|
||||
# if image was pasted from another object, create a copy
|
||||
image_to_update = image_to_update.clone_tinymce_asset(object) if image_to_update.object != object
|
||||
|
||||
next if image_to_update.object || image_to_update.team_id != Team.search_by_object(object).id
|
||||
|
||||
image_to_update&.update(object: object, saved: true)
|
||||
|
|
Loading…
Add table
Reference in a new issue