From 403965fe6fb6adbd0587be5e61c7602d315c265f Mon Sep 17 00:00:00 2001 From: naomi Date: Sun, 14 Feb 2021 12:39:38 +0000 Subject: [PATCH 1/2] removed error logging, also did something with the search, which now works --- css/opencase.css | 2 +- modules/opencase_entities/opencase_entities.module | 14 -------------- .../opencase_entities/src/Entity/OCActivity.php | 1 - .../config/install/views.view.actor_search.yml | 1 - 4 files changed, 1 insertion(+), 17 deletions(-) diff --git a/css/opencase.css b/css/opencase.css index a165884..96cbdb0 100644 --- a/css/opencase.css +++ b/css/opencase.css @@ -20,7 +20,7 @@ div[data-drupal-selector=edit-user-bulk-form] { } /* Free the people from the tyranny of the useless search button */ -#edit-submit-actor-search{ +#edit-submit-actor-search, #edit-submit-actor-search-2{ display: none; } diff --git a/modules/opencase_entities/opencase_entities.module b/modules/opencase_entities/opencase_entities.module index 4f68e6f..e3a6cd3 100644 --- a/modules/opencase_entities/opencase_entities.module +++ b/modules/opencase_entities/opencase_entities.module @@ -140,17 +140,3 @@ function opencase_entities_theme_suggestions_oc_event(array $variables) { 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); - } -} diff --git a/modules/opencase_entities/src/Entity/OCActivity.php b/modules/opencase_entities/src/Entity/OCActivity.php index de11390..a00a545 100644 --- a/modules/opencase_entities/src/Entity/OCActivity.php +++ b/modules/opencase_entities/src/Entity/OCActivity.php @@ -86,7 +86,6 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte public static function currentDateTime() { $current_time = DrupalDateTime::createFromTimestamp(time()); $formatted = $current_time->format('Y-m-d'); -error_log($formatted); return $formatted; } /** diff --git a/modules/opencase_search/config/install/views.view.actor_search.yml b/modules/opencase_search/config/install/views.view.actor_search.yml index 1b60e1d..690946e 100644 --- a/modules/opencase_search/config/install/views.view.actor_search.yml +++ b/modules/opencase_search/config/install/views.view.actor_search.yml @@ -45,7 +45,6 @@ display: expose_sort_order: true sort_asc_label: Asc sort_desc_label: Desc - text_input_required: 'Select any filter and click on Apply to see results' text_input_required_format: basic_html pager: type: mini From 715f5f34c48b07cac41cb47964dc4a5a30e3c760 Mon Sep 17 00:00:00 2001 From: naomi Date: Sun, 14 Feb 2021 21:14:33 +0000 Subject: [PATCH 2/2] Removed "Entered by" from actor view display --- modules/opencase_entities/src/Entity/OCActor.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/modules/opencase_entities/src/Entity/OCActor.php b/modules/opencase_entities/src/Entity/OCActor.php index 87c5fcb..e8cf721 100644 --- a/modules/opencase_entities/src/Entity/OCActor.php +++ b/modules/opencase_entities/src/Entity/OCActor.php @@ -235,12 +235,7 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface ->setRevisionable(TRUE) ->setSetting('target_type', 'user') ->setSetting('handler', 'default') - ->setTranslatable(TRUE) - ->setDisplayOptions('view', [ - 'label' => 'inline', - 'type' => 'author', - 'weight' => -10, - ]); + ->setTranslatable(TRUE); // 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') @@ -248,7 +243,7 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface ->setLabel(t('Name')) ->setRevisionable(TRUE) ->setSettings([ - 'max_length' => 50, + 'max_length' => 100, 'text_processing' => 0, ]) ->setDisplayConfigurable("form", true) @@ -274,8 +269,7 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface ->setDisplayOptions('form', [ 'type' => 'string_textfield', 'weight' => -9, - ]) - ->setRequired(TRUE); + ]); $fields['middle_names'] = BaseFieldDefinition::create('string') ->setLabel(t('Middle Names')) @@ -308,8 +302,7 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface ->setDisplayOptions('form', [ 'type' => 'string_textfield', 'weight' => -7, - ]) - ->setRequired(TRUE); + ]); // Contact details. $fields['email'] = BaseFieldDefinition::create('string')