Repository: plone/Products.CMFPlone

Issue:
custom bundle fix
Fix the resource registry to save the automatically generated filepath to the
compiled resource on the bundle object after compilation. The filepath is
always in the '++plone++static/' namespace. This fix makes custom bundles
actually includable.

@vangheem @bloodbare 

There are no tests yet. I'll have to finish something first...

@keul @zopyx this propably sovle some of your issues too!
by the way, the cause of the issue came obvious to me, after looking at the bundle compilation metadata via this fix: https://github.com/plone/mockup/pull/457

Maybe fixes #323



Discussion:

Resolving patch:
diff --git a/Products/CMFPlone/browser/ploneview.py b/Products/CMFPlone/browser/ploneview.py
--- a/Products/CMFPlone/browser/ploneview.py
+++ b/Products/CMFPlone/browser/ploneview.py
@@ -1,22 +1,21 @@
+# -*- coding: utf-8 -*-
 from Acquisition import aq_inner
+from plone.memoize.view import memoize
 from Products.CMFCore.utils import getToolByName
 from Products.CMFPlone import utils
 from Products.CMFPlone.browser.interfaces import IPlone
-from Products.CMFPlone.log import log_deprecated
 from Products.Five import BrowserView
-from plone.app.content.browser.folderfactories import _allowedTypes
-from plone.memoize.view import memoize
 from zope.component import getMultiAdapter
-from zope.deprecation import deprecated
+from zope.deprecation import deprecate
 from zope.i18n import translate
-from zope.interface import implements
+from zope.interface import implementer
 from zope.size import byteDisplay
 
 _marker = []
 
 
+@implementer(IPlone)
 class Plone(BrowserView):
-    implements(IPlone)
 
     # Utility methods
 
@@ -82,8 +81,10 @@ def showToolbar(self):
         if portal_membership.isAnonymousUser():
             return False
 
-        context_state = getMultiAdapter((context, request),
-                                        name="plone_context_state")
+        context_state = getMultiAdapter(
+            (context, request),
+            name="plone_context_state"
+        )
         actions = context_state.actions
 
         if actions('workflow', max=1):
@@ -112,15 +113,16 @@ def showToolbar(self):
                 return True
 
         # Check to see if the user is able to add content
-        allowedTypes = [fti for fti in _allowedTypes(request, context)]
+        allowedTypes = context.allowedContentTypes()
         if allowedTypes:
             return True
 
         return False
 
+    @deprecate('showEditableBorder is renamed to showToolbar')
     def showEditableBorder(self):
+        # remove in 5.1
         return self.showToolbar()
-    deprecated(showEditableBorder, 'showEditableBorder is renamed to showToolbar')
 
     def normalizeString(self, text):
         """Normalizes a title to an id.
@@ -226,36 +228,51 @@ def getViewTemplateId(self):
             name=u'plone_context_state')
         return context_state.view_template_id()
 
-    # Deprecated in favour of @@plone_layout
-
+    @deprecate(
+        "@@plone_view/mark_view as been deprecated, you should use "
+        "@@plone_layout/mark_view"
+    )
     def mark_view(self, view):
         """Adds a marker interface to the view if it is "the" view for the
         context May only be called from a template.
         """
-        log_deprecated("@@plone_view/mark_view as been deprecated, you should use "
-                       "@@plone_layout/mark_view")
         context = aq_inner(self.context)
         layout = getMultiAdapter((context, self.request), name=u'plone_layout')
         layout.mark_view(view)
 
+    @memoize
+    def patterns_settings(self):
+        context = aq_inner(self.context)
+        return getMultiAdapter(
+            (context, self.request),
+            name=u'plone_patterns_settings')()
+
+    @deprecate(  # remove in Plone 5.1
+        "@@plone_view/hide_columns as been deprecated, you should use "
+        "@@plone_layout/hide_columns"
+    )
     def hide_columns(self, column_left, column_right):
         """Returns a CSS class matching the current column status.
         """
-        log_deprecated("@@plone_view/hide_columns as been deprecated, you should use "
-                       "@@plone_layout/hide_columns")
         context = aq_inner(self.context)
         layout = getMultiAdapter((context, self.request), name=u'plone_layout')
         return layout.hide_columns(column_left, column_right)
 
+    @deprecate(  # remove in Plone 5.1
+        "@@plone_view/icons_visible as been deprecated, you should use "
+        "@@plone_layout/icons_visible"
+    )
     def icons_visible(self):
         """Returns True if icons should be shown or False otherwise.
         """
-        log_deprecated("@@plone_view/icons_visible as been deprecated, you should use "
-                       "@@plone_layout/icons_visible")
         context = aq_inner(self.context)
         layout = getMultiAdapter((context, self.request), name=u'plone_layout')
         return layout.icons_visible()
 
+    @deprecate(  # remove in Plone 5.1
+        "@@plone_view/getIcon as been deprecated, you should use "
+        "@@plone_layout/getIcon"
+    )
     def getIcon(self, item):
         """Returns an object which implements the IContentIcon interface and
         provides the informations necessary to render an icon. The item
@@ -263,34 +280,29 @@ def getIcon(self, item):
         globally or just for anonymous users with the icon_visibility property
         in site_properties.
         """
-        log_deprecated("@@plone_view/getIcon as been deprecated, you should use "
-                       "@@plone_layout/getIcon")
         context = aq_inner(self.context)
         layout = getMultiAdapter((context, self.request), name=u'plone_layout')
         return layout.getIcon(item)
 
+    @deprecate(  # remove in Plone 5.1
+        "@@plone_view/have_portlets as been deprecated, you should "
+        "use @@plone_layout/have_portlets"
+    )
     def have_portlets(self, manager_name, view=None):
         """Determine whether a column should be shown. The left column is
         called plone.leftcolumn; the right column is called plone.rightcolumn.
         """
-        log_deprecated("@@plone_view/have_portlets as been deprecated, you should "
-                       "use @@plone_layout/have_portlets")
         context = aq_inner(self.context)
         layout = getMultiAdapter((context, self.request), name=u'plone_layout')
         return layout.have_portlets(manager_name, view=view)
 
+    @deprecate(  # remove in Plone 5.1
+        "@@plone_view/bodyClass as been deprecated, you should use "
+        "@@plone_layout/bodyClass"
+    )
     def bodyClass(self, template, view):
         """Returns the CSS class to be used on the body tag.
         """
-        log_deprecated("@@plone_view/bodyClass as been deprecated, you should use "
-                       "@@plone_layout/bodyClass")
         context = aq_inner(self.context)
         layout = getMultiAdapter((context, self.request), name=u'plone_layout')
         return layout.bodyClass(template, view)
-
-    @memoize
-    def patterns_settings(self):
-        context = aq_inner(self.context)
-        return getMultiAdapter(
-            (context, self.request),
-            name=u'plone_patterns_settings')()


Test patch: