diff --git a/src/Form/UpdateForm.php b/src/Form/UpdateForm.php index d94e0ce..aa77802 100644 --- a/src/Form/UpdateForm.php +++ b/src/Form/UpdateForm.php @@ -86,13 +86,14 @@ class UpdateForm extends ConfirmFormBase { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { + $replication_manager = \Drupal::service('workspace.replicator_manager'); $upstream = $this->getUpstream(); $active = $this->getActive(); try { // Derive a replication task from the source Workspace. - $task = $this->replicatorManager->getTask($active->getWorkspace(), 'push_replication_settings'); + $task = $replicator_manager->getTask($active->getWorkspace(), 'pull_replication_settings'); - $response = $this->replicatorManager->update($upstream, $active, $task); + $response = $replicator_manager->update($upstream, $active, $task); if (($response instanceof ReplicationLogInterface) && $response->get('ok')) { drupal_set_message($this->t('%workspace has been updated with content from %upstream.', ['%upstream' => $upstream->label(), '%workspace' => $active->label()])); diff --git a/tests/src/Functional/ReplicatorTest.php b/tests/src/Functional/ReplicatorTest.php index 91d6ef2..6fa7738 100644 --- a/tests/src/Functional/ReplicatorTest.php +++ b/tests/src/Functional/ReplicatorTest.php @@ -2,9 +2,6 @@ namespace Drupal\Tests\workspace\Functional; -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\field\Entity\FieldConfig; -use Drupal\field\Entity\FieldStorageConfig; use Drupal\simpletest\BlockCreationTrait; use Drupal\simpletest\BrowserTestBase; use Drupal\taxonomy\Entity\Vocabulary; @@ -16,11 +13,16 @@ use Drupal\workspace\ReplicatorManager; * @group workspace */ class ReplicatorTest extends BrowserTestBase { + use WorkspaceTestUtilities; + use BlockCreationTrait { placeBlock as drupalPlaceBlock; } + /** + * {@inheritdoc} + */ public static $modules = ['system', 'node', 'user', 'block', 'workspace', 'multiversion', 'taxonomy', 'entity_reference', 'field', 'field_ui', 'menu_link_content', 'menu_ui']; /**