simplesconsultoria / sc.galleria.support

An simple gallery integration for Plone
4 stars 2 forks source link

Bug in galleria.py(261)galleriajs() #11

Closed cleberjsantos closed 12 years ago

cleberjsantos commented 12 years ago

The bug occurs when you insert a link object with to url of flickr or picasa.

TraceBack:


   - URL: .../src/sc.galleria.support/src/sc/galleria/support/browser/templates/galleria_view.pt
   - Line 108, Column 7
   - Expression: <PathExpr standard:u'view/galleriajs'>
   - Names:
      {'args': (),
       'container': <ATLink at /galleria/testando-a-galeria>,
       'context': <ATLink at /galleria/testando-a-galeria>,
       'default': <object object at 0xb776d6a0>,
       'here': <ATLink at /galleria/testando-a-galeria>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xb473dbbc>,
       'request': <HTTPRequest, URL=http://localhost:8080/galleria/testando-a-galeria/galleria_view>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0xb51797cc>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <Products.Five.metaclass.SimpleViewClass from /home/cleber/zope/develope/buildouts_255_317_336/src/sc.galleria.support/src/sc/galleria/support/browser/templates/galleria_view.pt object at 0xb479b12c>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0xb479b44c>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 155, in _eval
  Module Products.PageTemplates.Expressions, line 117, in render
  Module sc.galleria.support.browser.galleria, line 261, in galleriajs
AttributeError: 'SimpleViewClass from /home/cleber/zope/develope/bu' object has no attribute 'galleria_flickrid'
cleberjsantos commented 12 years ago

Solution is to pass the "plname" in the load Flickr and Picasa Plugin.

@@ -258,7 +262,7 @@ class Galleria(BrowserView):

                           })
                       }) """ % (str(self.settings.selector),
-                               str(self.galleria_flickrid()),
+                               str(self.plugins(plname='flickr')),
                                int(self.flickrplugin.flickr_max),
                                str(self.flickrplugin.flickr_desc).lower(),
                                int(self.settings.gallery_width),
@@ -293,8 +297,8 @@ class Galleria(BrowserView):
                       }) """ % (str(self.settings.selector),
                                int(self.picasaplugin.picasa_max),
                                str(self.picasaplugin.picasa_desc).lower(),
-                               str(self.galleria_picasauserandid()[0]),
-                               str(self.galleria_picasauserandid()[1]),
+                               str(self.plugins(plname='picasaweb')[0]),
+                               str(self.plugins(plname='picasaweb')[1]),
                                int(self.settings.gallery_width),
                                int(self.settings.gallery_height),
                                str(self.settings.autoplay).lower())