Update to Drupal 8.2.0. For more information, see https://www.drupal.org/project/drupal/releases/8.2.0
This commit is contained in:
parent
2f563ab520
commit
f1c8716f57
1732 changed files with 52334 additions and 11780 deletions
|
@ -26,8 +26,9 @@ trait ConditionAccessResolverTrait {
|
|||
$pass = $condition->execute();
|
||||
}
|
||||
catch (ContextException $e) {
|
||||
// If a condition is missing context, consider that a fail.
|
||||
$pass = FALSE;
|
||||
// If a condition is missing context and is not negated, consider that a
|
||||
// fail.
|
||||
$pass = $condition->isNegated();
|
||||
}
|
||||
|
||||
// If a condition fails and all conditions were needed, deny access.
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace Drupal\Core\Condition;
|
|||
use Drupal\Core\Executable\ExecutableManagerInterface;
|
||||
use Drupal\Core\Executable\ExecutablePluginBase;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Form\SubformStateInterface;
|
||||
use Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait;
|
||||
|
||||
/**
|
||||
|
@ -47,6 +48,9 @@ abstract class ConditionPluginBase extends ExecutablePluginBase implements Condi
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
|
||||
if ($form_state instanceof SubformStateInterface) {
|
||||
$form_state = $form_state->getCompleteFormState();
|
||||
}
|
||||
$contexts = $form_state->getTemporaryValue('gathered_contexts') ?: [];
|
||||
$form['context_mapping'] = $this->addContextAssignmentElement($this, $contexts);
|
||||
$form['negate'] = array(
|
||||
|
@ -68,6 +72,9 @@ abstract class ConditionPluginBase extends ExecutablePluginBase implements Condi
|
|||
*/
|
||||
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
|
||||
$this->configuration['negate'] = $form_state->getValue('negate');
|
||||
if ($form_state->hasValue('context_mapping')) {
|
||||
$this->setContextMapping($form_state->getValue('context_mapping'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Reference in a new issue