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

@@folderlisting (browser.py) uses control panel "Search" @@search-controlpanel types_not_searched #40

Open
yurj opened this issue Nov 15, 2021 · 0 comments

Comments

@yurj
Copy link

yurj commented Nov 15, 2021

Hi!

how to reproduce:

  1. go to @@search-controlpanel
  2. remove some content type
  3. create a folder
  4. add some content, removed in 2.
  5. the folder listing view says "There are currently no items in this folder."

the folder_listing shouldn't always list all content?

The problem is that, by default, portal_type kw is injected with the values from @@search-controlpanel types_not_searched

class FolderListing(BrowserView):

    def __call__(self, batch=False, b_size=20, b_start=0, orphan=0, **kw):
        query = {}
        query.update(kw) <- here

I think the problem is in browser/folder.py

        kwargs.update(self.request.get('contentFilter', {}))
        if 'object_provides' not in kwargs:  # object_provides is more specific
            kwargs.setdefault('portal_type', self.friendly_types)

friendly_types cames from portal and are set in plone/app/layout/globals/portal.py:

    @memoize_contextless
    def friendly_types(self):
        context = aq_inner(self.context)
        registry = getUtility(IRegistry)
        settings = registry.forInterface(ISearchSchema, prefix="plone")
        not_searched = settings.types_not_searched <- here

        types = getToolByName(context, "portal_types").listContentTypes()
        return [t for t in types if t not in not_searched]

I don't know where is should be solved if here or in plone.app.layout

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

No branches or pull requests

1 participant