Merge 5a7ff16726
into 8f73c593a1
This commit is contained in:
commit
11186e00f9
|
@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
- [Add min/max options to integer fields in farm_field.factory #768](https://github.com/farmOS/farmOS/pull/768)
|
- [Add min/max options to integer fields in farm_field.factory #768](https://github.com/farmOS/farmOS/pull/768)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- [Override the lab_test log timestamp label and description #774](https://github.com/farmOS/farmOS/pull/774)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- [Patch drupal/core to fix Issue #3414883: datetime_timestamp widget does not use default field value #771](https://github.com/farmOS/farmOS/pull/771)
|
- [Patch drupal/core to fix Issue #3414883: datetime_timestamp widget does not use default field value #771](https://github.com/farmOS/farmOS/pull/771)
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
config:
|
||||||
|
- log.type.lab_test
|
||||||
|
enforced:
|
||||||
|
module:
|
||||||
|
- farm_lab_test
|
||||||
|
id: log.lab_test.timestamp
|
||||||
|
field_name: timestamp
|
||||||
|
entity_type: log
|
||||||
|
bundle: lab_test
|
||||||
|
label: 'Date sampled'
|
||||||
|
description: 'The date when the sample was collected.'
|
||||||
|
required: true
|
||||||
|
translatable: true
|
||||||
|
default_value: { }
|
||||||
|
default_value_callback: 'Drupal\log\Entity\Log::getRequestTime'
|
||||||
|
settings: { }
|
||||||
|
field_type: timestamp
|
|
@ -176,3 +176,16 @@ function farm_lab_test_post_update_add_tissue_type(&$sandbox) {
|
||||||
]);
|
]);
|
||||||
$type->save();
|
$type->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the lab_test log timestamp label and description.
|
||||||
|
*/
|
||||||
|
function farm_lab_test_post_update_override_lab_test_timestamp_label_description(&$sandbox) {
|
||||||
|
|
||||||
|
// Override the timestamp field label and description on lab_test logs to
|
||||||
|
// make it clear that it should be used for the date the sample was taken.
|
||||||
|
$config = \Drupal::service('entity_field.manager')->getBaseFieldDefinitions('log')['timestamp']->getConfig('lab_test');
|
||||||
|
$config->set('label', 'Date sampled');
|
||||||
|
$config->set('description', 'The date when the sample was collected.');
|
||||||
|
$config->save();
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue