Skip to content
Snippets Groups Projects
Commit 9417f000 authored by Anand Toshniwal's avatar Anand Toshniwal Committed by Anand Toshniwal
Browse files

Issue #2926526 by anand.toshniwal93: Old token format should be updated to new Drupal 8 format

parent 3eee9d6a
Branches
Tags 8.x-1.0 8.x-1.0-alpha1
No related merge requests found
......@@ -135,7 +135,7 @@ class ViewsConditionalField extends FieldPluginBase {
if ($field == $this->options['id']) {
break;
}
$items[] = "[$field]";
$items[] = "{{ $field }}";
}
$form['replacements']['variables'] = [
'#theme' => 'item_list',
......@@ -191,17 +191,17 @@ class ViewsConditionalField extends FieldPluginBase {
// Search through field information for possible replacement variables.
foreach ( $labels as $key => $var) {
// If we find a replacement variable, replace it.
if (strpos($equalto, "[$key]") !== FALSE) {
if (strpos($equalto, "{{ $key }}") !== FALSE) {
$field = $this->clean_var($fields[$key]);
$equalto = $this->t(str_replace("[$key]", $field, $equalto));
$equalto = $this->t(str_replace("{{ $key }}", $field, $equalto));
}
if (strpos($then, "[$key]") !== FALSE) {
if (strpos($then, "{{ $key }}") !== FALSE) {
$field = $this->clean_var($fields[$key]);
$then = $this->t(str_replace("[$key]", $field, $then));
$then = $this->t(str_replace("{{ $key }}", $field, $then));
}
if (strpos($or, "[$key]") !== FALSE) {
if (strpos($or, "{{ $key }}") !== FALSE) {
$field = $this->clean_var($fields[$key]);
$or = $this->t(str_replace("[$key]", $field, $or));
$or = $this->t(str_replace("{{ $key }}", $field, $or));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment