Commits

tehfink  committed 1dc9761 Merge

salvator's bugfixes. thanks!

  • Participants
  • Parent commits b257942, a2e613a

Comments (0)

Files changed (1)

File cmsplugin_faq/cms_plugins.py

         page = None
         if obj:
             page = obj.page
-        plugins = plugin_pool.get_text_enabled_plugins(self.placeholder, page)
+        plugins = plugin_pool.get_text_enabled_plugins(self.placeholder)
         form = self.get_form_class(request, plugins)
         kwargs['form'] = form # override standard form
         return super(CMSFaqEntryPlugin, self).get_form(request, obj, **kwargs)
     
     def render(self, context, instance, placeholder):
 
-        #get all FaqEntryPlugin on this page
-        plugins = instance.page.cmsplugin_set.filter(plugin_type='CMSFaqEntryPlugin')
+        #get all FaqEntryPlugin on this page and this language
+        language = context.get('lang', settings.LANGUAGE_CODE)
+        plugins = instance.page.cmsplugin_set.filter(plugin_type='CMSFaqEntryPlugin', language=language)
         
         faqentry_plugins = []
 
         })
         return context
 
-plugin_pool.register_plugin(CMSFaqEntryLinkPlugin)
+plugin_pool.register_plugin(CMSFaqEntryLinkPlugin)