Skip to content
Snippets Groups Projects
Commit 0018afbe authored by Alexander Hass's avatar Alexander Hass
Browse files

Default value need to have PHP tags surrounded

parent 998d4102
No related branches found
No related tags found
Loading
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
$('[data-drupal-selector="edit-visibility-php"]').drupalSetSummary(function (context) { $('[data-drupal-selector="edit-visibility-php"]').drupalSetSummary(function (context) {
var $code = $(context).find('textarea[name="visibility[php][php]"]'); var $code = $(context).find('textarea[name="visibility[php][php]"]');
if ($code.val() === 'return TRUE;') { if ($code.val() === '<?php return TRUE; ?>') {
return Drupal.t('Not restricted'); return Drupal.t('Not restricted');
} }
else { else {
......
...@@ -27,7 +27,7 @@ class Php extends ConditionPluginBase { ...@@ -27,7 +27,7 @@ class Php extends ConditionPluginBase {
// By default the PHP snippet need to return TRUE or blocks will silently // By default the PHP snippet need to return TRUE or blocks will silently
// disappear after the module has been enabled and/or a block has been // disappear after the module has been enabled and/or a block has been
// configured without configuring a PHP snippet. // configured without configuring a PHP snippet.
return ['php' => 'return TRUE;'] + parent::defaultConfiguration(); return ['php' => '<?php return TRUE; ?>'] + parent::defaultConfiguration();
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment