Improvements for the view cookies module restriction check.

Created on 4 March 2024, 9 months ago
Updated 18 March 2024, 8 months ago

Problem/Motivation

Currently, we are checking if cookies for the specific service are accepted on the view preprocess to not render placeholder if it's not needed.

    // Gets cookies from the current request.
    $cookies = \Drupal::requestStack()
      ->getCurrentRequest()
      ->cookies
      ->get('cookiesjsr');
    // Checks if current service cookies accepted.
    // If it's accepted, then we don't need to add a placeholder, just let
    // view render as it is.
    if ($cookies && isset(json_decode($cookies)->$service)) {
      return;
    }

I'd like to suggest moving this validation on a step earlier to prevent breaking Ajax functionality for the view, which is JS probably caused. So, we'll check if cookies are accepted in the _cookies_addons_views_is_restricted() function instead.

✨ Feature request
Status

Fixed

Version

1.0

Component

Cookies Addons Views

Created by

πŸ‡ΊπŸ‡¦Ukraine _shy Ukraine, Lutsk πŸ‡ΊπŸ‡¦

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