When exporting views via Features, the 'remember_roles' entry contains a row for each role on your site. On a site with 200 roles it is not necessary to store 200 lines of zeroes - the 'remember_roles' array is array_filter()ed before use anyway, so we can filter it before saving and therefore only export the selected roles.

CommentFileSizeAuthor
views-array_filter-remember_roles.patch764 byteslongwave

Comments

longwave created an issue. See original summary.

zalak.addweb’s picture

Issue tags: +views
rob230’s picture

What is the point of remember_roles? It appears on every filter, even ones that have nothing to do with roles, and it remembers old roles that no longer exist, e.g.:

62 => 0,

Where 62 is a role that was deleted.

In every filter it appears on, the only key with a value is 2:

2 => '2',

Where 2 is the role ID of authenticated user.

I don't understand what it's meant to be saving. I can see nothing in the filter settings that it could be referring to.

rob230’s picture

Ah I found it. When you check 'Remember the last selection' there is a hidden field that becomes visible. I don't know why it needs to export all this junk, mostly zeroes and out-of-date values, when you export a view.

Edit: deleting it from your view export doesn't seem to affect it, so it isn't needed at all.

joelpittet’s picture

Priority: Minor » Normal
Status: Needs review » Reviewed & tested by the community
Issue tags: -views

This works if you save the view after applying the patch. It would be nice if the exporting did this but I can't be 100% if we do that generically and don't know how to target specific options to alter their export output.

joelpittet’s picture

Issue tags: +Quick fix
damienmckenna’s picture

Title: 'remember_roles' stores unnecessary data » 'remember_roles' optionstores unnecessary data
Status: Reviewed & tested by the community » Fixed
Parent issue: » #2960871: Plan for Views 7.x-3.23 release

Committed, with a small comment added.

  • DamienMcKenna committed baa13a5 on 7.x-3.x authored by longwave
    Issue #2793085 by longwave, Rob230, joelpittet: 'remember_roles' option...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.