Problem/Motivation

The insert_view_adv filter has a way to select specific views to embed via an allowed_views setting, but doesn't exclude any values that aren't set in the configuration set process. This causes:
- Configuration unnecessarily exported when it doesn't need to be. E.g.:
- Any text formats that do not use the insert_view_adv filter will still get the setting exported with a list of views
- If no views are selected, then all views are allowed. However the filter plugin will record ALL views available in the system as part of the plugin settings export. This can be a lot of unnecessary config export when a site has many views.
- The filter plugin adds the serialized configuration to the render placeholder, which means that the serialized list of ALL allowed views is stored into cache_render entries which takes up cache bin space.

Steps to reproduce

1. Enable the module
2. Edit a text format and save it without enabling the insert_view_adv filter, then save the text format.
3. Export the text format settings, all the enabled views on the site will be serialized into the text format settings despite not using the filter.

Proposed resolution

Exclude allowed_views that aren't selected from the configuration and exported state.

Comments

angrytoast created an issue. See original summary.

angrytoast’s picture

Status: Active » Needs review
StatusFileSize
new1.04 KB

First pass at a patch

a.dmitriiev’s picture

Thanks for the patch and feedback. It sounds reasonable. I will check it shortly.

a.dmitriiev’s picture

Sorry, but I can't reproduce this:

- Any text formats that do not use the insert_view_adv filter will still get the setting exported with a list of views

If text format doesn't have the filter as active, its settings are not exported. And if it would be like that, it would be drupal core issue.

I take my last words back, it is very strange that the inactive filter settings are still exported. I will check other filters and how they deal with this.

a.dmitriiev’s picture

I see that it is the same behavior for all the filters, and that is very strange.

a.dmitriiev’s picture

The patch was committed. Thank you. But I am very surprised why inactive filters export their configurations?? Maybe it should be reported as core bug?

a.dmitriiev’s picture

Status: Needs review » Fixed
angrytoast’s picture

Thanks for the quick review. That is curious, I'll check up the core queue to see if I can find anything there.

Status: Fixed » Closed (fixed)

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