mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-10 00:11:22 +08:00
Merge pull request #4847 from artoscinote/ma_SCI_7774
Fix copying and pasting TinyMCE images [SCI-7774]
This commit is contained in:
commit
c7dc9efe10
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