Merge branch 'dev' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase into dev

This commit is contained in:
dh_6sdxgm 2021-02-14 13:19:14 -08:00
commit 0f0281c58c
4 changed files with 4 additions and 27 deletions

View File

@ -140,17 +140,3 @@ function opencase_entities_theme_suggestions_oc_event(array $variables) {
return $suggestions; return $suggestions;
} }
/* Presave hook on actor entities to manage user creation.
- If a linked user already exists with that email, it does nothing.
- If a user exists with that email but it has no linked actor, it links it.
- If a user exists with that email which already has a linked actor, it fails validation.
- If a linked user exists with a different email, it updates the email.
*/
function opencase_entities_oc_actor_presave(Drupal\Core\Entity\EntityInterface $entity) {
if ($entity->get('user_login')->value) {
error_log($entity->get('first_name')->value);
error_log($entity->get('last_name')->value);
error_log($entity->get('email')->value);
}
}

View File

@ -86,7 +86,6 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte
public static function currentDateTime() { public static function currentDateTime() {
$current_time = DrupalDateTime::createFromTimestamp(time()); $current_time = DrupalDateTime::createFromTimestamp(time());
$formatted = $current_time->format('Y-m-d'); $formatted = $current_time->format('Y-m-d');
error_log($formatted);
return $formatted; return $formatted;
} }
/** /**

View File

@ -235,12 +235,7 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
->setRevisionable(TRUE) ->setRevisionable(TRUE)
->setSetting('target_type', 'user') ->setSetting('target_type', 'user')
->setSetting('handler', 'default') ->setSetting('handler', 'default')
->setTranslatable(TRUE) ->setTranslatable(TRUE);
->setDisplayOptions('view', [
'label' => 'inline',
'type' => 'author',
'weight' => -10,
]);
// When configuring a person type, you will need to choose whether to have full name or first and last name fields displayed. // When configuring a person type, you will need to choose whether to have full name or first and last name fields displayed.
$fields['full_name'] = BaseFieldDefinition::create('string') $fields['full_name'] = BaseFieldDefinition::create('string')
@ -248,7 +243,7 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
->setLabel(t('Name')) ->setLabel(t('Name'))
->setRevisionable(TRUE) ->setRevisionable(TRUE)
->setSettings([ ->setSettings([
'max_length' => 50, 'max_length' => 100,
'text_processing' => 0, 'text_processing' => 0,
]) ])
->setDisplayConfigurable("form", true) ->setDisplayConfigurable("form", true)
@ -274,8 +269,7 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
->setDisplayOptions('form', [ ->setDisplayOptions('form', [
'type' => 'string_textfield', 'type' => 'string_textfield',
'weight' => -9, 'weight' => -9,
]) ]);
->setRequired(TRUE);
$fields['middle_names'] = BaseFieldDefinition::create('string') $fields['middle_names'] = BaseFieldDefinition::create('string')
->setLabel(t('Middle Names')) ->setLabel(t('Middle Names'))
@ -308,8 +302,7 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
->setDisplayOptions('form', [ ->setDisplayOptions('form', [
'type' => 'string_textfield', 'type' => 'string_textfield',
'weight' => -7, 'weight' => -7,
]) ]);
->setRequired(TRUE);
// Contact details. // Contact details.
$fields['email'] = BaseFieldDefinition::create('string') $fields['email'] = BaseFieldDefinition::create('string')

View File

@ -45,7 +45,6 @@ display:
expose_sort_order: true expose_sort_order: true
sort_asc_label: Asc sort_asc_label: Asc
sort_desc_label: Desc sort_desc_label: Desc
text_input_required: 'Select any filter and click on Apply to see results'
text_input_required_format: basic_html text_input_required_format: basic_html
pager: pager:
type: mini type: mini