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.
Issue fork cookies_addons-3425420
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
_shyComment #4
_shyComment #5
guido_sGood point.
I checked the merge request.
Code makes sense to me.
I only suggested small changes for the comments to improve grammar and understandability.
Comment #7
_shy