Merge c085d84e5b
into fb6fd0d0bc
This commit is contained in:
commit
79c94e1df3
|
@ -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
|
||||
|
|
|
@ -42,6 +42,7 @@ class FarmEntityFieldTest extends KernelTestBase {
|
|||
'farm_log_asset',
|
||||
'farm_owner',
|
||||
'farm_parent',
|
||||
'state_machine',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -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().
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue