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

Avalaible but not installed p.a.imagecropping prevents site from creating scales. #90

Open
agitator opened this issue Aug 10, 2017 · 4 comments
Labels

Comments

@agitator
Copy link
Member

Created a new Plone5.1x site to test some things within an instance that had p.a.imagecropping available.

  • Imagecropping was not installed/activated in that test site.
  • Uploaded some images to add them to a page
  • Tiny showed the inserted image as not available, because the scale couldn't be created.
  • Didn't get an error, even with "NotFound" enabled for error logs.
  • Switching to album_view showed the error
  • Installing/activating Imagecropping solved the "problem"
2017-08-10 09:53:26 ERROR Zope.SiteErrorLog 1502351606.120.776631047704 http://localhost:11080/vanilla/album_view
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module Products.Five.browser.metaconfigure, line 485, in __call__
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  Module zope.pagetemplate.pagetemplate, line 137, in pt_render
  Module five.pt.engine, line 98, in __call__
  Module z3c.pt.pagetemplate, line 163, in render
  Module chameleon.zpt.template, line 261, in render
  Module chameleon.template, line 191, in render
  Module chameleon.template, line 171, in render
  Module 23b32c9236181f2942ea3c49951930f5.py, line 931, in render
  Module d6297c063aebd309e3816d6023aa3a01.py, line 1223, in render_master
  Module d6297c063aebd309e3816d6023aa3a01.py, line 420, in render_content
  Module 23b32c9236181f2942ea3c49951930f5.py, line 919, in __fill_content_core
  Module 23b32c9236181f2942ea3c49951930f5.py, line 123, in render_content_core
  Module 23b32c9236181f2942ea3c49951930f5.py, line 305, in render_listing
  Module plone.memoize.volatile, line 73, in replacement
  Module plone.namedfile.scaling, line 504, in tag
  Module plone.namedfile.scaling, line 489, in tag
  Module plone.namedfile.scaling, line 429, in scale
  Module plone.scale.storage, line 210, in scale
  Module plone.app.imagecropping.dx, line 66, in __call__
  Module plone.registry.registry, line 82, in forInterface
KeyError: 'Interface `plone.app.imagecropping.browser.settings.ISettings` defines a field `constrain_cropping`, for which there is no record.'

 - Expression: "python:image_scale.tag(image, 'image', scale='thumb')"
 - Filename:   ... lone/app/contenttypes/browser/templates/listing_album.pt
 - Location:   (line 31: col 38)
 - Source:     ... ure python:image_scale.tag(image, 'image', scale='thumb')" / ...
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Arguments:  repeat: {...} (0)
               template: <ViewPageTemplateFile - at 0x10d025d90>
               views: <ViewMapper - at 0x10d740890>
               modules: <instance - at 0x1058e8680>
               args: <tuple - at 0x104bbe050>
               here: <ImplicitAcquisitionWrapper vanilla at 0x10b498640>
               user: <ImplicitAcquisitionWrapper - at 0x10b4f7fa0>
               nothing: <NoneType - at 0x104abee18>
               container: <ImplicitAcquisitionWrapper vanilla at 0x10b498640>
               request: <instance - at 0x10d8f5b00>
               wrapped_repeat: <SafeMapping - at 0x10d7f80a8>
               traverse_subpath: <list - at 0x10d8fa248>
               default: <object - at 0x104c14af0>
               loop: {...} (1)
               context: <ImplicitAcquisitionWrapper vanilla at 0x10b498640>
               view: <SimpleViewClass from /Users/peter/workspace/gaychads/srccore/plone.app.contenttypes/plone/app/contenttypes/browser/templates/listing_album.pt album_view at 0x10d025e50>
               translate: <function translate at 0x10d907398>
               root: <ImplicitAcquisitionWrapper Zope at 0x10b467c30>
               options: {...} (0)
               target_language: <NoneType - at 0x104abee18>

@agitator agitator added the bug label Aug 10, 2017
@hvelarde
Copy link
Member

the problem is event subscribers are registered at Zope level and work even when package is uninstalled.

IIRC, at the beginning of the subbscriber's code you can check if the package browser layer is provided by the request or not; if not, just return and do nothing.

@MrTango
Copy link
Contributor

MrTango commented Jun 8, 2020

this is still broken ;)

@1letter
Copy link

1letter commented Jun 9, 2020

I had today the same Problem. What helped for me : install/uninstall the AddOn.

@mck9
Copy link

mck9 commented Mar 15, 2022

I had today the same Problem. What helped for me : install/uninstall the AddOn.

as this is still broken, above solution from @1letter worked also for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants