Commit fd3884c7 authored by alexpott's avatar alexpott
Browse files

Issue #2014033 by kgoel, hussainweb: Replace drupal_container() with...

Issue #2014033 by kgoel, hussainweb: Replace drupal_container() with Drupal::service() in the content_translation() module.
parent 6ff8caaf
...@@ -867,7 +867,7 @@ function content_translation_field_info_alter(&$info) { ...@@ -867,7 +867,7 @@ function content_translation_field_info_alter(&$info) {
function content_translation_entity_presave(EntityInterface $entity) { function content_translation_entity_presave(EntityInterface $entity) {
$entity_info = $entity->entityInfo(); $entity_info = $entity->entityInfo();
if ($entity->isTranslatable() && !empty($entity_info['fieldable'])) { if ($entity->isTranslatable() && !empty($entity_info['fieldable'])) {
$attributes = drupal_container()->get('request')->attributes; $attributes = Drupal::request()->attributes;
Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $attributes->get('working_langcode'), $attributes->get('source_langcode')); Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $attributes->get('working_langcode'), $attributes->get('source_langcode'));
} }
} }
......
...@@ -294,7 +294,7 @@ function content_translation_delete_confirm_submit(array $form, array &$form_sta ...@@ -294,7 +294,7 @@ function content_translation_delete_confirm_submit(array $form, array &$form_sta
// @todo This should be taken care of by the Path module. // @todo This should be taken care of by the Path module.
if (module_exists('path')) { if (module_exists('path')) {
$conditions = array('source' => $controller->getViewPath($entity), 'langcode' => $language->langcode); $conditions = array('source' => $controller->getViewPath($entity), 'langcode' => $language->langcode);
drupal_container()->get('path.crud')->delete($conditions); Drupal::service('path.crud')->delete($conditions);
} }
$form_state['redirect'] = $controller->getBasePath($entity) . '/translations'; $form_state['redirect'] = $controller->getBasePath($entity) . '/translations';
......
...@@ -435,7 +435,7 @@ public function entityFormEntityBuild($entity_type, EntityInterface $entity, arr ...@@ -435,7 +435,7 @@ public function entityFormEntityBuild($entity_type, EntityInterface $entity, arr
// Set contextual information that can be reused during the storage phase. // Set contextual information that can be reused during the storage phase.
// @todo Remove this once we have an EntityLanguageDecorator to deal with // @todo Remove this once we have an EntityLanguageDecorator to deal with
// the active language. // the active language.
$attributes = drupal_container()->get('request')->attributes; $attributes = \Drupal::request()->attributes;
$attributes->set('working_langcode', $form_langcode); $attributes->set('working_langcode', $form_langcode);
$attributes->set('source_langcode', $source_langcode); $attributes->set('source_langcode', $source_langcode);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment