Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates: (deps): Update drupal/views_bulk_operations requirement from 4.1.4 to 4.2.3 #3281

Merged
merged 19 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bd275df
Updates: (deps): Update drupal/views_bulk_operations requirement
dependabot[bot] Jan 11, 2023
9f73654
Update setContext to be compatible with the parent
nkoporec Mar 7, 2023
387b791
Update buildPreConfigurationForm to be compatible with the interface
nkoporec Mar 7, 2023
21cb7e2
Fix ViewsBulkOperationsBulkForm compatibility
nkoporec Mar 7, 2023
5671007
Fix social_event_managers vbo compatibility
nkoporec Mar 7, 2023
a562959
Fix social_event_managers vbo compatibility
nkoporec Mar 7, 2023
6a284e8
Fix actionManager type
nkoporec Mar 7, 2023
2637077
Fix SocialGroupViewsBulkOperationsAccess vbo compatibility
nkoporec Mar 7, 2023
84079d5
Fix getRouteName no null error
nkoporec Mar 8, 2023
e84ea64
Fix VBO actions on manage-all-enrollments pages
nkoporec Mar 8, 2023
c82c297
Remove ignored PHPStan errors, as we fixed them in previous commits, …
nkoporec Mar 8, 2023
baa70a0
Fix result counting when doing the VBO actions, this was a change in the
nkoporec Mar 10, 2023
f1ad300
Add a patch for views_bulk_operations
nkoporec Mar 9, 2023
df6bfaa
Rewrite the select all checkbox, so that it fixes the issues found by
nkoporec Mar 9, 2023
9df9709
Fix PHPStan type hint, as it contains a typo.
nkoporec Mar 9, 2023
801983b
Remove an additional whitespace, which was added by mistake.
nkoporec Mar 10, 2023
3f3942b
Fix PHPStan type hints, so that CI does not reject it.
nkoporec Mar 10, 2023
1d503e7
Bump VBO version to latest one
nkoporec Sep 7, 2023
ffc03b7
Merge branch 'main' into dependabot/composer/drupal/views_bulk_operat…
nkoporec Sep 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@
},
"drupal/redirect": {
"Redirection issue when interface language is different from content language": "https://www.drupal.org/files/issues/2020-06-01/redirect-interface_language_different_from_content_language_2991423-13.patch"
},
"drupal/views_bulk_operations": {
"Issue #3347030: Add #submit attribute to ConfigureAction form": "https://git.drupalcode.org/project/views_bulk_operations/-/merge_requests/57.diff"
}
}
},
Expand Down Expand Up @@ -163,6 +166,7 @@
"drupal/token": "1.12.0",
"drupal/ultimate_cron": "2.0.0-alpha6",
"drupal/update_helper": "3.0.4",
"drupal/views_bulk_operations": "4.2.4",
"drupal/url_embed": "2.0.0-alpha1",
"drupal/views_bulk_operations": "4.1.4",
"drupal/views_infinite_scroll": "2.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static function create(ContainerInterface $container, array $configuratio
/**
* {@inheritdoc}
*/
public function viewsForm(array &$form, FormStateInterface $form_state) {
public function viewsForm(array &$form, FormStateInterface $form_state): void {
parent::viewsForm($form, $form_state);

$wrapper = &$form['header'][$this->options['id']];
Expand All @@ -114,7 +114,7 @@ public function viewsForm(array &$form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*/
public function viewsFormSubmit(array &$form, FormStateInterface $form_state) {
public function viewsFormSubmit(array &$form, FormStateInterface $form_state): void {
parent::viewsFormSubmit($form, $form_state);

$redirect = $form_state->getRedirect();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ public function updateSelection(
break;
}

/** @var array $view_data */
$this->setTempstoreData($view_data);

$count = empty($view_data['exclude_mode'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,7 @@ function _social_event_managers_action_batch_finish($success, array $results, ar
return;
}

$operations = array_count_values($results['operations']);
$results_count = 0;

foreach ($operations as $count) {
$results_count += $count;
}
$results_count = $results['operations'][0]['count'];

$hook = 'social_event_managers_action_' . $results['action'] . '_finish';

Expand Down Expand Up @@ -570,10 +565,11 @@ function social_event_managers_social_event_managers_action_social_event_manager
* Add node ID to the route of action confirmation step.
*/
function _social_event_managers_views_bulk_operations_bulk_form_submit($form, FormStateInterface $form_state) {
/** @var \Drupal\Core\Url $url */
$node = '';

/** @var \Drupal\Core\Url|null $url */
$url = $form_state->getRedirect();

$node = '';
if ($form_state->get('node')) {
$node = $form_state->get('node');
}
Expand All @@ -582,17 +578,27 @@ function _social_event_managers_views_bulk_operations_bulk_form_submit($form, Fo
$node = $route->id();
}

if (empty($node)) {
return;
}

$route_parameters = [
'node' => $node,
];

if (!empty($node)) {
if ($url->getRouteName() === 'views_bulk_operations.execute_configurable') {
$url = Url::fromRoute('social_event_managers.vbo.execute_configurable', $route_parameters);
}
if ($url->getRouteName() === 'social_event_managers.vbo.confirm') {
$url = Url::fromRoute('social_event_managers.vbo.confirm', $route_parameters);
}
// If we have confirm route then just go with it.
if ($url && $url->getRouteName() === "social_event_managers.vbo.confirm") {
$url = Url::fromRoute('social_event_managers.vbo.confirm', $route_parameters);
$form_state->setRedirectUrl($url);
return;
}

// For additional configurations, such as 'Send email' action.
if ($form['#id'] !== 'views-bulk-operations-configure-action') {
$url = Url::fromRoute('social_event_managers.vbo.execute_configurable', $route_parameters);
}
else {
$url = Url::fromRoute('social_event_managers.vbo.confirm', $route_parameters);
}

$form_state->setRedirectUrl($url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function access($object, AccountInterface $account = NULL, $return_as_obj
/**
* {@inheritdoc}
*/
public function buildPreConfigurationForm(array $form, array $values, FormStateInterface $form_state) {
public function buildPreConfigurationForm(array $form, array $values, FormStateInterface $form_state): array {
return $form;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SocialEventManagersViewsBulkOperationsBulkForm extends ViewsBulkOperations
*
* @var \Drupal\Core\Action\ActionManager
*/
protected $actionManager;
protected $pluginActionManager;

/**
* Constructs a new SocialEventManagersViewsBulkOperationsBulkForm object.
Expand Down Expand Up @@ -83,7 +83,7 @@ public function __construct(
parent::__construct($configuration, $plugin_id, $plugin_definition, $viewData, $actionManager, $actionProcessor, $tempStoreFactory, $currentUser, $requestStack);

$this->entityTypeManager = $entity_type_manager;
$this->actionManager = $pluginActionManager;
$this->pluginActionManager = $pluginActionManager;
}

/**
Expand All @@ -108,7 +108,7 @@ public static function create(ContainerInterface $container, array $configuratio
/**
* {@inheritdoc}
*/
public function getBulkOptions() {
public function getBulkOptions(): array {
$bulk_options = parent::getBulkOptions();

if ($this->view->id() !== 'event_manage_enrollments') {
Expand Down Expand Up @@ -136,7 +136,7 @@ public function getBulkOptions() {
/**
* {@inheritdoc}
*/
public function viewsForm(array &$form, FormStateInterface $form_state) {
public function viewsForm(array &$form, FormStateInterface $form_state): void {
$this->view->setExposedInput(['status' => TRUE]);

parent::viewsForm($form, $form_state);
Expand Down Expand Up @@ -198,6 +198,8 @@ public function viewsForm(array &$form, FormStateInterface $form_state) {
}
// Add the Event ID to the data.
$tempstoreData['event_id'] = $event->id();

/** @var array $tempstoreData */
$this->setTempstoreData($tempstoreData, $this->view->id(), $this->view->current_display);

// Reorder the form array.
Expand Down Expand Up @@ -225,8 +227,9 @@ public function viewsForm(array &$form, FormStateInterface $form_state) {

// Render select all results checkbox.
if (!empty($wrapper['select_all'])) {
$total_results = is_array($this->tempStoreData) ? $this->tempStoreData['total_results'] : 0;
$wrapper['select_all']['#title'] = $this->t('Select / unselect all @count members across all the pages', [
'@count' => $this->tempStoreData['total_results'] ? ' ' . $this->tempStoreData['total_results'] : '',
'@count' => ' ' . $total_results,
]);
// Styling attributes for the select box.
$form['header'][$this->options['id']]['select_all']['#attributes']['class'][] = 'form-no-label';
Expand Down Expand Up @@ -340,7 +343,7 @@ public function viewsFormValidate(&$form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*/
public function viewsFormSubmit(array &$form, FormStateInterface $form_state) {
public function viewsFormSubmit(array &$form, FormStateInterface $form_state): void {
parent::viewsFormSubmit($form, $form_state);

if ($form_state->get('step') === 'views_form_views_form' && $this->view->id() === 'event_manage_enrollments') {
Expand Down Expand Up @@ -414,7 +417,7 @@ public function getEntityLabel(EntityInterface $entity) {
/**
* {@inheritdoc}
*/
protected function getTempstoreData($view_id = NULL, $display_id = NULL) {
protected function getTempstoreData($view_id = NULL, $display_id = NULL): ?array {
$data = parent::getTempstoreData($view_id, $display_id);

if (is_array($data) && $data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Drupal\social_group_gvbo\Access;

use Drupal\Core\Access\AccessResult;
use Drupal\Core\Routing\RouteMatch;
use Drupal\Core\Session\AccountInterface;
use Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess;
Expand All @@ -14,7 +15,7 @@ class SocialGroupViewsBulkOperationsAccess extends ViewsBulkOperationsAccess {
/**
* {@inheritdoc}
*/
public function access(AccountInterface $account, RouteMatch $routeMatch) {
public function access(AccountInterface $account, RouteMatch $routeMatch): AccessResult {
$parameters = [
'view_id' => 'group_manage_members',
'display_id' => 'page_group_manage_members',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SocialGroupInviteViewsBulkOperationsBulkForm extends ViewsBulkOperationsBu
/**
* {@inheritdoc}
*/
public function getBulkOptions() {
public function getBulkOptions(): array {
$bulk_options = parent::getBulkOptions();

if ($this->view->id() !== 'social_group_invitations') {
Expand Down Expand Up @@ -85,6 +85,7 @@ public function viewsForm(array &$form, FormStateInterface $form_state): void {
$tempstoreData['group_id'] = $group->id();
}

/** @var array $tempstoreData */
$this->setTempstoreData($tempstoreData, $this->view->id(), $this->view->current_display);

// Reorder the form array.
Expand All @@ -104,8 +105,9 @@ public function viewsForm(array &$form, FormStateInterface $form_state): void {

// Render select all results checkbox.
if (!empty($wrapper['select_all'])) {
$total_results = is_array($this->tempStoreData) ? $this->tempStoreData['total_results'] : 0;
$wrapper['select_all']['#title'] = $this->t('Select / unselect all @count invites across all the pages', [
'@count' => $this->tempStoreData['total_results'] ? ' ' . $this->tempStoreData['total_results'] : '',
'@count' => ' ' . $total_results,
]);
// Styling attributes for the select box.
$form['header'][$this->options['id']]['select_all']['#attributes']['class'][] = 'form-no-label';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SocialGroupViewsBulkOperationsBulkForm extends ViewsBulkOperationsBulkForm
/**
* {@inheritdoc}
*/
public function getBulkOptions() {
public function getBulkOptions(): array {
$bulk_options = parent::getBulkOptions();

if ($this->view->id() !== 'group_manage_members') {
Expand Down Expand Up @@ -67,7 +67,7 @@ public function getBulkOptions() {
/**
* {@inheritdoc}
*/
public function viewsForm(array &$form, FormStateInterface $form_state) {
public function viewsForm(array &$form, FormStateInterface $form_state): void {
$this->view->setExposedInput(['status' => TRUE]);

parent::viewsForm($form, $form_state);
Expand Down Expand Up @@ -118,6 +118,7 @@ public function viewsForm(array &$form, FormStateInterface $form_state) {
$tempstoreData['group_id'] = $group->id();
}

/** @var array $tempstoreData */
$this->setTempstoreData($tempstoreData, $this->view->id(), $this->view->current_display);

// Reorder the form array.
Expand All @@ -137,8 +138,9 @@ public function viewsForm(array &$form, FormStateInterface $form_state) {

// Render select all results checkbox.
if (!empty($wrapper['select_all'])) {
$total_results = is_array($this->tempStoreData) ? $this->tempStoreData['total_results'] : 0;
$wrapper['select_all']['#title'] = $this->t('Select / unselect all @count members across all the pages', [
'@count' => $this->tempStoreData['total_results'] ? ' ' . $this->tempStoreData['total_results'] : '',
'@count' => ' ' . $total_results,
]);
// Styling attributes for the select box.
$form['header'][$this->options['id']]['select_all']['#attributes']['class'][] = 'form-no-label';
Expand Down Expand Up @@ -259,7 +261,7 @@ public function viewsFormValidate(&$form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*/
public function viewsFormSubmit(array &$form, FormStateInterface $form_state) {
public function viewsFormSubmit(array &$form, FormStateInterface $form_state): void {
parent::viewsFormSubmit($form, $form_state);

if ($form_state->get('step') === 'views_form_views_form' && $this->view->id() === 'group_manage_members') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public static function create(ContainerInterface $container, array $configuratio
/**
* {@inheritdoc}
*/
public function setContext(array &$context) {
public function setContext(array &$context): void {
parent::setContext($context);
// @todo make the batch size configurable.
$context['batch_size'] = Settings::get('social_mail_batch_size', 25);
Expand Down Expand Up @@ -213,7 +213,8 @@ public function getEmail(UserInterface $account) {
/**
* {@inheritdoc}
*/
public function buildPreConfigurationForm(array $form, array $values, FormStateInterface $form_state) {
public function buildPreConfigurationForm(array $form, array $values, FormStateInterface $form_state): array {
return [];
}

/**
Expand Down
Loading
Loading