Issue #2811519 by tim.plunkett, dbourrion, cilefen, futurmat: Blocks do not appear after being placed with the Rules module enabled (or other missing schemata for Condition plugins)
parent
59e527c52c
commit
ed3202c302
|
@ -323,7 +323,7 @@ class BlockForm extends EntityForm {
|
|||
// However, certain form elements may return it as 0/1. Cast here to
|
||||
// ensure the data is in the expected type.
|
||||
if (array_key_exists('negate', $values)) {
|
||||
$values['negate'] = (bool) $values['negate'];
|
||||
$form_state->setValue(['visibility', $condition_id, 'negate'], (bool) $values['negate']);
|
||||
}
|
||||
|
||||
// Allow the condition to validate the form.
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\block_test\Plugin\Condition;
|
||||
|
||||
use Drupal\Core\Condition\ConditionPluginBase;
|
||||
|
||||
/**
|
||||
* Provides a 'missing_schema' condition.
|
||||
*
|
||||
* @Condition(
|
||||
* id = "missing_schema",
|
||||
* label = @Translation("Missing schema"),
|
||||
* )
|
||||
*/
|
||||
class MissingSchema extends ConditionPluginBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function evaluate() {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function summary() {
|
||||
return 'Summary';
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue