Issue #2003498 by DmitryDrozdik, kgoel, ebeyrent, pwieck, travis-echidna, Gaelan, disasm, LinL, herom: Replace drupal_container() with Drupal::service() in the comment module.

8.0.x
Nathaniel Catchpole 2013-10-13 13:21:03 +01:00
parent 82c9aff7be
commit 42ea242a63
4 changed files with 4 additions and 4 deletions

View File

@ -861,7 +861,7 @@ function comment_links(CommentInterface $comment, EntityInterface $entity, $fiel
} }
// Add translations link for translation-enabled comment bundles. // Add translations link for translation-enabled comment bundles.
if (module_exists('content_translation') && content_translation_translate_access($comment)) { if (\Drupal::moduleHandler()->moduleExists('content_translation') && content_translation_translate_access($comment)) {
$links['comment-translations'] = array( $links['comment-translations'] = array(
'title' => t('translate'), 'title' => t('translate'),
'href' => 'comment/' . $comment->id() . '/translations', 'href' => 'comment/' . $comment->id() . '/translations',

View File

@ -141,7 +141,7 @@ function comment_views_data() {
), ),
); );
if (module_exists('language')) { if (\Drupal::moduleHandler()->moduleExists('language')) {
$data['comment']['langcode'] = array( $data['comment']['langcode'] = array(
'title' => t('Language'), 'title' => t('Language'),
'help' => t('The language the comment is in.'), 'help' => t('The language the comment is in.'),

View File

@ -38,7 +38,7 @@ class StatisticsLastCommentName extends FieldPluginBase {
) )
) )
); );
$join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition); $join = \Drupal::service('plugin.manager.views.join')->createInstance('standard', $definition);
// nes_user alias so this can work with the sort handler, below. // nes_user alias so this can work with the sort handler, below.
$this->user_table = $this->query->ensureTable('ces_users', $this->relationship, $join); $this->user_table = $this->query->ensureTable('ces_users', $this->relationship, $join);

View File

@ -28,7 +28,7 @@ class StatisticsLastCommentName extends SortPluginBase {
'left_table' => 'comment_entity_statistics', 'left_table' => 'comment_entity_statistics',
'left_field' => 'last_comment_uid', 'left_field' => 'last_comment_uid',
); );
$join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition); $join = \Drupal::service('plugin.manager.views.join')->createInstance('standard', $definition);
// @todo this might be safer if we had an ensure_relationship rather than guessing // @todo this might be safer if we had an ensure_relationship rather than guessing
// the table alias. Though if we did that we'd be guessing the relationship name // the table alias. Though if we did that we'd be guessing the relationship name