Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

IImageScaleTraversable is provided by all types of dexterity items (I think this makes the interface useless) #1129

Closed
fgrcon opened this issue Oct 3, 2015 · 4 comments

Comments

@fgrcon
Copy link
Member

fgrcon commented Oct 3, 2015

in plone.app.dexterity/plone/app/dexterity/configure.zcml:

...class class="plone.dexterity.content.DexterityContent">
<!-- Make it possible to traverse to image scales on Dexterity content -->
implements interface="plone.namedfile.interfaces.IImageScaleTraversable" 
/class 

Removing that and changing plone.app.contenttypes.content.py:

...
+from plone.namedfile.interfaces import IImageScaleTraversable
...
@implementer(IImage)
+@implementer(IImageScaleTraversable)
class Image(Item):
"""Convenience subclass for ``Image`` portal type
"""

... Rebuild Catalog:
Only images and other types which explicitly implement it provide the interface

@thet
Copy link
Member

thet commented Oct 6, 2015

sounds reasonable, but don't know about the reasoning behind having IImageScaleTraversable available on all content. @pbauer ?

we have to make sure that objects with the ILeadImage behavior also provides the IImageScaleTraversable.

@fgrcon
Copy link
Member Author

fgrcon commented Oct 6, 2015

Agreed to that but folder/@@images/image/something does not make sense and leads to not found ...
see also #1074

@thet @pbauer could this be done in the leadimage behaviour somehow ?

@fgrcon
Copy link
Member Author

fgrcon commented Oct 6, 2015

I just branched back: this really would break Lead Image behaviour

File "/usr/local/p5dev/buildout.coredev/eggs/Zope2-2.13.23-py2.7.egg/OFS/Traversable.py", line 300, in unrestrictedTraverse
raise e
AttributeError: @@images

  • Expression: "context/@@images"
  • Filename: ... ntenttypes/plone/app/contenttypes/behaviors/leadimage.pt
  • Location: (line 3: col 28)
  • Source: tal:define="scale_func context/@@images;
    ^^^^^^^^^^^^^^^^
  • Arguments: repeat: {...} (0) .....

@fgrcon
Copy link
Member Author

fgrcon commented Oct 10, 2015

found a better solution for my issue ...

@fgrcon fgrcon closed this as completed Oct 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants