This commit is contained in:
Michael Stenta 2024-02-19 20:02:20 -07:00 committed by GitHub
commit 79c94e1df3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 0 deletions

View File

@ -36,6 +36,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [Improve asset and log CSV exports #783](https://github.com/farmOS/farmOS/pull/783)
- [Remove "All" from "Items per page" options in Views #776](https://github.com/farmOS/farmOS/pull/776)
### Changed
- [Make "done" the default log status #782](https://github.com/farmOS/farmOS/pull/782)
## [3.0.1] 2024-01-18
### Added

View File

@ -42,6 +42,7 @@ class FarmEntityFieldTest extends KernelTestBase {
'farm_log_asset',
'farm_owner',
'farm_parent',
'state_machine',
];
/**

View File

@ -6,8 +6,20 @@
*/
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_entity_base_field_info_alter().
*/
function farm_log_entity_base_field_info_alter(&$fields, EntityTypeInterface $entity_type) {
// Make "done" the default log status.
if ($entity_type->id() == 'log') {
$fields['status']->setDefaultValue('done');
}
}
/**
* Implements hook_entity_prepare_form().
*/