--- a/src/pyams_content/component/gallery/zmi/file.py Wed Feb 07 11:49:55 2018 +0100
+++ b/src/pyams_content/component/gallery/zmi/file.py Wed Feb 07 11:50:51 2018 +0100
@@ -46,6 +46,7 @@
from pyramid.view import view_config
from z3c.form import field
from zope.lifecycleevent import ObjectCreatedEvent
+from zope.location import locate
from pyams_content import _
@@ -97,6 +98,7 @@
for content, filename in extractor.get_contents():
try:
media = GalleryFile()
+ locate(media, self.context)
media.data = filename, content
except WrongType:
continue
@@ -106,6 +108,7 @@
else:
try:
media = GalleryFile()
+ locate(media, self.context)
media.data = filename, medias_data if filename else medias_data
except WrongType:
pass