getSite () returns the componentβs closest site (where local utilities can be stored), which in fact means only what was last installed using setSite (), which usually happens during a crawl.
In most cases, the only workaround that calls setSite () is the one that fires when it passes through the Plone site. But I think that the old KSS validation mechanism used (uses?) A hack that creates the site of the local component on the fly (in the view) and sets it as the local site for the remainder of the request so that it can override certain things.
You can disable the check (for example, disable the corresponding KSS file in portal_kss) or fix c.quickupload to check if the result of getSite () is ISiteRoot. If this is not the case, it should be wrapped in an acquisition, so you can do aq_parent (site) (or perhaps. Parent site) to get the parent in the loop until you find ISiteRoot.
source share