You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a persistent tile with various fields, including a NamedBlobImage. Editing and viewing works fine. But the widget links to a url where you can download the original image, and this url is wrong. The original is useful to have, especially when an editor accidentally deletes or messes up the page and you want to try to recreate the tile from a local copy.
Problems:
I don’t know where to fix the download url.
Even if I knew, I don’t know what the correct download url would be.
I guess this could be reproduced with the image tile from plone.app.standardtiles, but this is disabled by default, and I don’t know how to enable it. In portal_registry I have added plone.app.standardtiles.image to the list in plone.app.tiles, but I still cannot insert an image tile.
On 1: The download url is calculated in plone.formwidget.namedfile.widget.NamedFileWidget.download_url, which uses the absolute_url of the context as base. The context is the current document, but it should be the tile. So fixing the download url might need to happen in plone.app.tiles/browser/configure.zcml, in class .traversal.EditTile. It gets the data and wraps it with self.context: AcquirableDictionary(dataManager.get()).__of__(self.context). Instead of self.context, this might need to be the persistent tile, but I could not get this to work.
I tried several combinations of those two urls, but all I got was 404s.
Is this another case of: yes, you can use persistent tiles and it will mostly work, but please don’t?
Can an image be stored in a transient tile (if that is still the right term) without adding it to the schema of the content (with an extra field or a behavior)? I know I could use a rich text tile, but I need the image separately.
#334 (comment) says something that we missed while creating these tile definitions last year:
We've already agreed that standalone image tiles were bad idea and those are already deprecated in favour of using content images and image fields in Mosaic 2.0.
So would the idea then be the following?
First upload the image as standard Plone content type, completely outside of Mosaic.
Insert this image in Mosaic by adding inserting a tile from Advanced > Existing Content.
Alternatively, which would fit our use case better: create a custom transient tile with a link (relation or uuid) to an image.
The text was updated successfully, but these errors were encountered:
We upgraded to Plone 5.2 with Py3 and I noticed the exact same thing as you described here. But in our case there is also a bug:
If I edit a tile with an image-field the image gets deleted although I checked the keep-existing-image option. Do you have this as well?
And... I see I have the same problem that you have. Tried on Plone 5.2.2 with Py 2.7 and 3.7, on a database migrated from Plone 5.1. I edit a tile with image, change nothing, save, and the image is gone.
At that point, I can still cancel the edit then and the image is back.
It might be related, but this seems a different issue.
Plone 5.1.5 with standard Mosaic version (2.1.1).
I have a persistent tile with various fields, including a
NamedBlobImage
. Editing and viewing works fine. But the widget links to a url where you can download the original image, and this url is wrong. The original is useful to have, especially when an editor accidentally deletes or messes up the page and you want to try to recreate the tile from a local copy.Problems:
On 1: The download url is calculated in
plone.formwidget.namedfile.widget.NamedFileWidget.download_url
, which uses theabsolute_url
of the context as base. The context is the current document, but it should be the tile. So fixing the download url might need to happen inplone.app.tiles/browser/configure.zcml
, in class.traversal.EditTile
. It gets the data and wraps it with self.context:AcquirableDictionary(dataManager.get()).__of__(self.context)
. Instead ofself.context
, this might need to be the persistent tile, but I could not get this to work.On 2:
Is this another case of: yes, you can use persistent tiles and it will mostly work, but please don’t?
Can an image be stored in a transient tile (if that is still the right term) without adding it to the schema of the content (with an extra field or a behavior)? I know I could use a rich text tile, but I need the image separately.
#334 (comment) says something that we missed while creating these tile definitions last year:
So would the idea then be the following?
The text was updated successfully, but these errors were encountered: