I am looking into Expert.php and I am seeing this:
$wrappers = [
'lbw' => $this->t('Label wrapper'),
'ow' => $this->t('Wrapper'),
'fis' => $this->t('Field items'),
'fi' => $this->t('Field item'),
];
foreach ($wrappers as $wrapper_key => $title) {
if (!empty($values[$wrapper_key])) {...
The token expansion/replacement happens down in this loop/if, but prefix and suffix are different fields than the four listed above and their replacement shouldn't be conditioned by the usage of other fields.
Am I missing something?
The problem is with XSS::filterAdmin
If you try running this in console:
drush php-eval 'print Drupal\Component\Utility\Xss::filterAdmin("<a href=\"[block_content:field_remote_url:uri]\">");'
the output is:
<a href="uri]">
So it breaks the token, just as I saw previously by placing logs in the ds.module. Please see comment #51.
@swentel Yes, I have a block with two fields (image and remote_url) and I am using DS to output the image enclosed in the remote URL.
I didn't look into the tests, but I am guessing if it is a unit test for the Expert.php of course it will work because the tokens will be passed correctly to the function. The problem arises if the prefix/suffix containing tokens are passed to the Xss::filterAdmin that will cut part of the tokens.
I can confirm that the moved code from ds.module to Expert.php does NOT do what it is supposed to.
I have run some tests and the Xss::filterAdmin has to come AFTER token expansion, as it was in previous patches.
In my example, I have an image field with expert configuration, prefix:
<a href="[block_content:field_remote_url:uri]">
and suffix:
</a>
In this configuration, after running the following line from ds.module:
$variables['settings'][$wrapper_element_name] = !empty($variables['settings'][$wrapper_element_name]) ? Xss::filterAdmin($variables['settings'][$wrapper_element_name]) : '';
the prefix becomes:
<a href="uri]">
So basically the Xss::filterAdmin cuts the "[block_content:field_remote_url:" breaking the prefix.
Reverting to the previous versions of the code (with the expansion of tokens before the Xss:filterAdmin) brings back the functionality.
This looks like an error with deprecated jquery functions in v3 and removed in v4. I have just updated some of my sites to drupal 11, and because jquery gets updated to v4, both colorbox and slick carousel are broken. The key is to update the js libraries to be JQuery compatible.
Please read the slick project page for more info about this: Slick project page →
If you want to use colorbox on upgraded jquery please look at
This are the modifications needed for making colorbox compatible with newer jquery versions:
https://github.com/jackmoore/colorbox/pull/908/files
Maybe a warning on the project page should be in order, just like on the slick project, to clarify that even the module is Drupal 11 compatible, actually it won't work unless you use a jquery compatible colorbox library.
For easy testing I attached the modified files to replace in the drupal's library folder.
MR!7 RTBC +1