Skip to content

Commit a2fed01

Browse files
committed
Merge branch 'main' into feature/drupal-10
2 parents 079f845 + fb9eb26 commit a2fed01

File tree

4 files changed

+38
-5
lines changed

4 files changed

+38
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.9.5] - 2022-1-11
8+
### Fixed
9+
- Validate access on each submitted entity for bulk action
10+
11+
## [1.9.4] - 2021-12-16
12+
### Fixed
13+
- Fix PHP 8.1 warnings
14+
715
## [1.9.3] - 2021-12-08
816
### Fixed
917
- Fix weight not persisting when using DraggableOverviewBuilderBase

css/filter-form.css

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@
2323
margin-left: 0.5rem;
2424
}
2525

26-
.wmentity-overview-filter-form__actions {
27-
margin-left: .5rem; /* LTR */
26+
.wmentity-overview-filter-form .form-item:last-child {
27+
/* LTR */
28+
margin-right: 1rem;
2829
}
2930

30-
[dir="rtl"] .wmentity-overview-filter-form__actions {
31-
margin-left: 0;
32-
margin-right: .5rem;
31+
[dir="rtl"] .wmentity-overview-filter-form .form-item:last-child {
32+
margin-right: 0;
33+
margin-left: 1rem;
34+
}
35+
36+
.wmentity-overview-filter-form .form-item .claro-autocomplete {
37+
width: auto;
3338
}
3439

3540
.wmentity-overview-filter-form__actions .button {

src/FilterStorage/FilterStorageBase.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,31 @@ abstract class FilterStorageBase implements FilterStorageInterface, \ArrayAccess
1010
/** @var EntityTypeInterface */
1111
protected $entityType;
1212

13+
#[\ReturnTypeWillChange]
1314
public function offsetExists($offset)
1415
{
1516
return $this->offsetGet($offset) !== null;
1617
}
1718

19+
#[\ReturnTypeWillChange]
1820
public function offsetGet($offset)
1921
{
2022
return $this->get($offset);
2123
}
2224

25+
#[\ReturnTypeWillChange]
2326
public function offsetSet($offset, $value)
2427
{
2528
$this->set($offset, $value);
2629
}
2730

31+
#[\ReturnTypeWillChange]
2832
public function offsetUnset($offset)
2933
{
3034
$this->remove($offset);
3135
}
3236

37+
#[\ReturnTypeWillChange]
3338
public function getIterator()
3439
{
3540
return new ArrayIterator($this->getAll());

src/Form/BulkActionForm.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,21 @@ public function validateForm(array &$form, FormStateInterface $formState): void
140140
$subFormState = SubformState::createForSubform($form['configuration']['form'], $form, $formState);
141141
$entities = $this->getEntities($formState);
142142

143+
if ($action instanceof ActionInterface) {
144+
foreach ($entities as $entity) {
145+
if (!$action->access($entity)) {
146+
$formState->setErrorByName(
147+
sprintf('%s:%s', $entity->getEntityTypeId(), $entity->bundle()),
148+
sprintf(
149+
'"%s" is not allowed in "%s" Bulk operation',
150+
$entity->label(),
151+
(string) ($action->getPluginDefinition()['label'] ?? $action->getPluginId())
152+
)
153+
);
154+
}
155+
}
156+
}
157+
143158
if ($action instanceof PluginFormInterface) {
144159
$action->validateConfigurationForm($form, $subFormState);
145160
}

0 commit comments

Comments
 (0)