Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
views-array_filter-remember_roles.patch | 764 bytes | longwave | |
|
Comments
Comment #2
zalak.addweb CreditAttribution: zalak.addweb commentedComment #3
Rob230 CreditAttribution: Rob230 commentedWhat 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.:
Where 62 is a role that was deleted.
In every filter it appears on, the only key with a value is 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.
Comment #4
Rob230 CreditAttribution: Rob230 commentedAh 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.
Comment #5
joelpittetThis 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.
Comment #6
joelpittetComment #7
DamienMcKennaCommitted, with a small comment added.