Issue #2003498 by DmitryDrozdik, kgoel, ebeyrent, pwieck, travis-echidna, Gaelan, disasm, LinL, herom: Replace drupal_container() with Drupal::service() in the comment module.
parent
82c9aff7be
commit
42ea242a63
|
@ -861,7 +861,7 @@ function comment_links(CommentInterface $comment, EntityInterface $entity, $fiel
|
|||
}
|
||||
|
||||
// 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(
|
||||
'title' => t('translate'),
|
||||
'href' => 'comment/' . $comment->id() . '/translations',
|
||||
|
|
|
@ -141,7 +141,7 @@ function comment_views_data() {
|
|||
),
|
||||
);
|
||||
|
||||
if (module_exists('language')) {
|
||||
if (\Drupal::moduleHandler()->moduleExists('language')) {
|
||||
$data['comment']['langcode'] = array(
|
||||
'title' => t('Language'),
|
||||
'help' => t('The language the comment is in.'),
|
||||
|
|
|
@ -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.
|
||||
$this->user_table = $this->query->ensureTable('ces_users', $this->relationship, $join);
|
||||
|
|
|
@ -28,7 +28,7 @@ class StatisticsLastCommentName extends SortPluginBase {
|
|||
'left_table' => 'comment_entity_statistics',
|
||||
'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
|
||||
// the table alias. Though if we did that we'd be guessing the relationship name
|
||||
|
|
Loading…
Reference in New Issue