Do not override existing filters in automatic update

Created on 14 February 2025, 2 months ago

Problem/Motivation

The update function _views_core_entity_reference_update_as_a_reference blindly writes the renamed filter to the filter array. This can override existing filters which is bad.

Steps to reproduce

  • Have a view with the filters field_related_articles_target_id_reference and field_related_articles_target_id.
  • Install this module.
  • Notice the absence of the old field_related_articles_target_id filter, having been overwritten by the new field_related_articles_target_id filter which is the renamed field_related_articles_target_id_reference filter.

Proposed resolution

Use \Drupal\views\ViewExecutable::generateHandlerId to generate a unique filter ID and use it throughout all the properties.

Remaining tasks

  • Implement solution
  • Implement tests
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany tgauges

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024