Skip to content

Commit

Permalink
Adds Entity Clone and removes Replicate #158.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinfunk committed Jan 25, 2020
1 parent b70d098 commit d3260c3
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 215 deletions.
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@
"Improve Field Widget UX for single-cardinality File/Image fields | http://drupal.org/node/2825555":
"https://www.drupal.org/files/issues/2018-06-16/entity_browser-single-value-widget-ux-2825555-20-D8.patch"
},
"drupal/entity_clone": {
"Allow fields implementing EntityReferenceFieldItemListInterface to clone their referenced entities | https://drupal.org/node/3013286":
"https://www.drupal.org/files/issues/2019-02-22/3013286-8.patch"
},
"drupal/gdpr": {
"Add icon to custom toolbar item | http://drupal.org/node/2972047":
"https://www.drupal.org/files/issues/2019-12-03/add-icon-to-custom-toolbar-item-2972047-12.patch"
Expand Down Expand Up @@ -230,6 +234,7 @@
"drupal/default_content_deploy": "1.0.0-alpha6",
"drupal/dx8_addtoany": "^1.1",
"drupal/entity_gallery": "1.x-dev",
"drupal/entity_clone": "1.0-beta3",
"drupal/entity_usage": "2.0.0-beta1",
"drupal/facets": "1.4.0",
"drupal/field_formatter_class": "1.1.0",
Expand Down Expand Up @@ -261,8 +266,6 @@
"drupal/page_manager": "4.0-beta4",
"drupal/radix": "~4.6.0",
"drupal/refreshless": "1.0.0-alpha3",
"drupal/replicate": "1.x-dev",
"drupal/replicate_ui": "1.x-dev",
"drupal/responsive_preview": "1.0-beta1",
"drupal/restui": "1.17.0",
"drupal/revision_log_default": "1.0.0",
Expand Down
171 changes: 51 additions & 120 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 3 additions & 10 deletions drupal-org.make
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ projects[entity_browser][patch][] = https://www.drupal.org/files/issues/2018-06-
projects[entity_browser][version] = 2.4
projects[entity_browser_block][type] = module
projects[entity_browser_block][version] = 1.0
projects[entity_clone][type] = module
projects[entity_clone][patch][] = https://www.drupal.org/files/issues/2019-02-22/3013286-8.patch
projects[entity_clone][version] = 1.0-beta3
projects[entity_embed][type] = module
projects[entity_embed][version] = 1.0
projects[entity_gallery][type] = module
Expand Down Expand Up @@ -292,16 +295,6 @@ projects[redirect][type] = module
projects[redirect][version] = 1.5
projects[refreshless][type] = module
projects[refreshless][version] = 1.0-alpha3
projects[replicate][type] = module
projects[replicate][download][type] = git
projects[replicate][download][url] = https://git.drupalcode.org/project/replicate.git
projects[replicate][download][branch] = 1.x
projects[replicate][download][revision] = 77a694ab24797b15caa84b39dab2ac4fb467ca69
projects[replicate_ui][type] = module
projects[replicate_ui][download][type] = git
projects[replicate_ui][download][url] = https://git.drupalcode.org/project/replicate_ui.git
projects[replicate_ui][download][branch] = 1.x
projects[replicate_ui][download][revision] = 7ef1e609c52583f99b4f46604d17614561c68529
projects[responsive_preview][type] = module
projects[responsive_preview][version] = 1.0-beta1
projects[restui][type] = module
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies:
- df_tools_layout
- df_tools_workflow
- content_browser
- entity_clone
- image
- language
- link
Expand All @@ -22,7 +23,6 @@ dependencies:
- metatag
- node
- pathauto
- replicate_ui
- text
- taxonomy
- user
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
form_settings:
file:
disable: true
hidden: true
default_value: false
media:
disable: true
hidden: true
default_value: false
taxonomy_term:
disable: true
hidden: true
default_value: false

This file was deleted.

3 changes: 1 addition & 2 deletions modules/df/df_tools/df_tools_blocks/df_tools_blocks.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
- content_browser
- entity_block
- entity_browser_block
- entity_clone
- df_core
- df_tools_crop
- df_tools_icons
Expand All @@ -22,5 +23,3 @@ dependencies:
- text
- user
- responsive_image
- replicate
- replicate_ui
28 changes: 0 additions & 28 deletions modules/df/df_tools/df_tools_blocks/df_tools_blocks.module
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,6 @@ function df_tools_blocks_form_alter(&$form, FormStateInterface $form_state, $for
$form['info']['widget'][0]['value']['#description'] = [];
}

if (preg_match('/^block_content_\X*_edit_form$/', $form_id)) {
// Add a 'copy' button to all custom blocks edit forms.
$form['actions']['copy'] = [
'#type' => 'submit',
'#value' => t('Copy'),
'#submit' => ['df_tools_blocks_block_content_replicate'],
'#weight' => 9,
];
}

// Add a callback to #process to the layout_builder_update_block and
// layout_builder_add_block. drupal.org/node/3028391
$form_ids = ['layout_builder_update_block', 'layout_builder_add_block'];
Expand Down Expand Up @@ -608,24 +598,6 @@ function df_tools_blocks_panels_ipe_blocks_alter(&$block_info) {
$block_info = array_values($block_info);
}

/**
* Form submission handler for df_tools_blocks_form_alter().
*/
function df_tools_blocks_block_content_replicate($form, FormStateInterface $form_state) {
// Retrieve block content entity from form_state.
$entity = $form_state->getFormObject()->getEntity();
// Extract a few values from the entity.
$block_info = $entity->get('info')->value;
$block_id = $entity->id();
// Replicate the block content entity.
if (\Drupal::service('df_tools_blocks.copier')->makeCopy($entity)) {
$message = t('Block Content: copied @info [id:@id]', ['@info' => $block_info, '@id' => $block_id]);
\Drupal::logger('df_tools_blocks')->info($message);
\Drupal::messenger()->addMessage($message, 'status');
}
// Redirect to block list comes free!
}

/**
* Implements hook_theme().
*/
Expand Down

This file was deleted.

38 changes: 0 additions & 38 deletions modules/df/df_tools/df_tools_blocks/src/Copier.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
form_settings:
cohesion_layout:
default_value: true
hidden: true
disable: false
Loading

0 comments on commit d3260c3

Please sign in to comment.