Compatibility issue with the viewsreference module

Created on 5 September 2025, 9 days ago

Problem/Motivation

The cookies_addons_views module creates a compatibility issue with the viewsreference module that results in JavaScript errors.

Error encountered:
Uncaught TypeError: Cannot read properties of undefined (reading 'replace') at new Drupal.views.ajaxView (ajax_view.js:104-107)

Steps to reproduce

1. Install cookies_addons_views module
2. Install viewsreference module
3. Create a view with viewsreference fields that is restricted by cookies_addons
4. Visit the page with cookie restrictions active
5. Observe JavaScript error in browser console

Proposed resolution

In cookies_addons_views_views_pre_render(), after removing the views AJAX settings, also remove the #viewsreference marker to prevent viewsreference from adding problematic settings.

Remaining tasks

- Apply the proposed fix to cookies_addons_views module
- Test with various viewsreference configurations

User interface changes

None - this is a bug fix that maintains existing functionality.

API changes

None - the changes are internal to the module's behavior.

Data model changes

None - this only affects JavaScript behavior and AJAX handling.

🐛 Bug report
Status

Active

Version

1.3

Component

Cookies Addons Views

Created by

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