use $this->base_table and remove an if

Created on 26 May 2013, over 11 years ago
Updated 28 February 2023, almost 2 years ago

Follow up for #1498674: Refactor node properties to multilingual

Problem/Motivation

Simplify code

In 1498674 was the @todo

     // @todo: Wouldn't it be possible to use $this->base_table and no if here?

On the line in the patch in comment #303:
3698

The line of the final patch might change but that info might help to find them.

For example,

     // @todo: Wouldn't it be possible to use $this->base_table and no if here?
-    if ($view->storage->get('base_table') == 'node_revision') {
-      $this->additional_fields['nid'] = array('table' => 'node_revision', 'field' => 'nid');
+    if ($view->storage->get('base_table') == 'node_field_revision') {
+      $this->additional_fields['nid'] = array('table' => 'node_field_revision', 'field' => 'nid');
     }
     else {
       $this->additional_fields['nid'] = array('table' => 'node', 'field' => 'nid');

Proposed resolution

use $this->base_table and remove the if

Remaining Tasks

  • use git blame to identify the issue that added this @todo and link to it, and link it back to here.

User interface changes

No.

API changes

No.

📌 Task
Status

Needs work

Version

10.1

Component
Taxonomy 

Last updated 3 days ago

  • Maintained by
  • 🇺🇸United States @xjm
  • 🇬🇧United Kingdom @catch
Created by

🇺🇸United States yesct

Live updates comments and jobs are added and updated live.
  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024