Skip to content

Instantly share code, notes, and snippets.

View alex-bukach's full-sized avatar

Alexander Bukach alex-bukach

  • Paramytha, Cyprus
View GitHub Profile
<?php
// Move Drupal 8 fields from one entity type to another.
// @see https://www.drupal.org/project/field_tools/issues/1349646#comment-13329737
$poc_fields = [
'field_adl_iadl',
'field_asa_referrals',
'field_authorized_for_lifeline_se',
'field_backup_plans',
'field_care_coordination_sec_12',
'field_care_coordination_sec_19',
diff --git a/src/Plugin/views/field/DraggableViewsField.php b/src/Plugin/views/field/DraggableViewsField.php
index bfade16..93c4420 100755
--- a/src/Plugin/views/field/DraggableViewsField.php
+++ b/src/Plugin/views/field/DraggableViewsField.php
@@ -62,7 +62,7 @@ class DraggableViewsField extends BulkForm {
// Item to keep id of the entity.
$form[$this->options['id']][$row_index]['id'] = array(
'#type' => 'hidden',
- '#value' => $row->{$this->definition['entity field']},
+ '#value' => $this->getEntity($row)->id(),
diff --git a/core/modules/block_content/block_content.info.yml b/core/modules/block_content/block_content.info.yml
index b9ae564..0dd5b56 100644
--- a/core/modules/block_content/block_content.info.yml
+++ b/core/modules/block_content/block_content.info.yml
@@ -6,6 +6,7 @@ version: VERSION
core: 8.x
dependencies:
- block
+ - entity
- text
diff --git a/modules/elasticsearch_connector_search_api/service.inc b/modules/elasticsearch_connector_search_api/service.inc
index 53ab927..5fb13c0 100644
--- a/modules/elasticsearch_connector_search_api/service.inc
+++ b/modules/elasticsearch_connector_search_api/service.inc
@@ -61,6 +61,9 @@ class SearchApiElasticsearchConnector extends SearchApiAbstractService {
if ($this->cluster_id) {
$this->elasticsearchClient = elasticsearch_connector_get_client_by_id($this->cluster_id);
}
+ if (!$this->elasticsearchClient) {
+ $this->elasticsearchClient = new \Elasticsearch\Client();