Make "done" the default log status #782
This commit is contained in:
parent
1c404b5152
commit
fb27e9ed5b
|
@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
- [Announce new releases on farmOS.discourse.group #780](https://github.com/farmOS/farmOS/pull/780)
|
||||
|
||||
### Changed
|
||||
|
||||
- [Make "done" the default log status #782](https://github.com/farmOS/farmOS/pull/782)
|
||||
|
||||
## [3.0.1] 2024-01-18
|
||||
|
||||
### Added
|
||||
|
|
|
@ -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