Skip to content

Commit

Permalink
Fix bulk move/group action log names when unsetting location/group fa…
Browse files Browse the repository at this point in the history
  • Loading branch information
mstenta committed May 8, 2023
1 parent a13a0de commit 2b3bb21
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- [Fix bulk move/group action log names when unsetting location/group #669](https://github.com/farmOS/farmOS/pull/669)

### Security

- Update Drupal core to 9.5.8 for [SA-CORE-2023-005](https://www.drupal.org/sa-core-2023-005)
Expand Down
5 changes: 4 additions & 1 deletion modules/asset/group/src/Form/AssetGroupActionForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
// Generate a name for the log.
$asset_names = farm_log_asset_names_summary($accessible_entities);
$group_names = farm_log_asset_names_summary($groups);
$log_name = $this->t('Group @assets into @groups', ['@assets' => $asset_names, '@groups' => $group_names]);
$log_name = $this->t('Clear group membership of @assets', ['@assets' => $asset_names]);
if (!empty($group_names)) {
$log_name = $this->t('Group @assets into @groups', ['@assets' => $asset_names, '@groups' => $group_names]);
}

// Create the log.
$log = Log::create([
Expand Down
5 changes: 4 additions & 1 deletion modules/core/location/src/Form/AssetMoveActionForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
// Generate a name for the log.
$asset_names = farm_log_asset_names_summary($accessible_entities);
$location_names = farm_log_asset_names_summary($locations);
$log_name = $this->t('Move @assets to @locations', ['@assets' => $asset_names, '@locations' => $location_names]);
$log_name = $this->t('Clear location of @assets', ['@assets' => $asset_names]);
if (!empty($location_names)) {
$log_name = $this->t('Move @assets to @locations', ['@assets' => $asset_names, '@locations' => $location_names]);
}

// Create the log.
$log = Log::create([
Expand Down

0 comments on commit 2b3bb21

Please sign in to comment.