Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
$.fn.jsCallback
currently uses this code:
js_token: (module && callback && Drupal.settings.js && Drupal.settings.js.tokens && Drupal.settings.js.tokens[module + '-' + callback]) || null
.
This leads to the string "null" being posted for js_token
.
This again leads to trouble with anonymous token verification as the check ($is_anonymous && empty($_js['token']))
in js_execute_request()
wont work.
Proposed resolution
Simply use an empty string instead null:
js_token: (module && callback && Drupal.settings.js && Drupal.settings.js.tokens && Drupal.settings.js.tokens[module + '-' + callback]) || ''
.
Remaining tasks
Reviews needed.
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
js-js_token-do-not-use-null-in-js.patch | 564 bytes | das-peter |
Comments
Comment #2
markhalliwell