Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294909

Filter out non-selected roles for the remember_roles setting in views

$
0
0

Problem/Motivation

Every exposed filter has a checkbox that allows it to be remembered through the session. Not only that, there's also an option to limit that functionality to certain user roles.

Even when that checkbox is off, the view still stores a list of all non-selected roles:

          expose:
            operator_id: ''
            label: Published
            description: ''
            use_operator: false
            operator: status_op
            identifier: status
            required: false
            remember: false
            multiple: false
            remember_roles:
              authenticated: authenticated
              anonymous: '0'
              ***_editor: '0'
              ***_clientadmin: '0'
              administrator: '0'

I don't think there are config dependencies for this but it does make more complicated to re-use views/put them as default config in a module because you tend to have left-over things in there from custom roles. "remember_roles:" exists almost 200x in this projects config sync folder which means 800 lines of useless yaml to parse :) And projects often have a lot more roles.

Proposed resolution

Filter out non-selected roles. Maybe even not store anything if the remember setting is off?

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes


Viewing all articles
Browse latest Browse all 294909

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>