#1498674: Refactor node properties to multilingual has split various fields out from the {node} table into {node_field_data}, which has a row for each node + language.
Since there are now different rows per node, SQL queries which previously used node.status/changed/... should now use node_field_data.status/changed/..., for one of the specific language rows. Figuring out how all individual queries could now be improved to make use of language specific properties, was split into followup issues, and @todos were inserted in various parts of the code.
Three of the places where there still is a @todo, have now moved into the ForumManager class.
Remaining tasks
Figure out whether and how the query should work on different language rows in {node_field_data}, dependent on language context.
Change the code or remove the @todos, in 4 places in tracker.module.
Original issue text follows
Problem/Motivation
Simplify code
In 1498674 was the @todo
@todo This should be actually filtering on the desired language and just fall back to the default language.
On the line in the patch in comment #303:
3741, 3752, 3763, 3774 and 3792.
The line of the final patch might change but that info might help to find them.
For example,
- $result = db_query_range('SELECT nid, uid, status FROM {node} WHERE nid <= :max_nid ORDER BY nid DESC', 0, $batch_size, array(':max_nid' => $max_nid), array('target' => 'slave'));
+ // @todo This should be actually filtering on the desired language and just
+ // fall back to the default language.
+ $result = db_query_range('SELECT nid, uid, status FROM {node_field_data} WHERE nid <= :max_nid AND default_langcode = 1 ORDER BY nid DESC', 0, $batch_size, array(':max_nid' => $max_nid), array('target' => 'slave'));;
Proposed resolution
@todo This should be actually filtering on the desired language and just fall back to the default language.
User interface changes
No.
API changes
No.
Comments
Comment #1
xjm(Merging "node system" and "node.module" components for 8.x; disregard.)
Comment #2
roderikAll 5 places are in tracker.module, so assigning component.
Actually 4 are... The 5th is in tracker.pages.inc and this will disappear because the sort just isn't necessary there. (Will be deleted as part of #2068331: Convert comment SQL queries to the Entity Query API, after #2259209: Fix CommentStatistics::read() gets committed.)
Comment #3
plachComment #4
dawehnerSee #1941830: Convert tracker listings to a view
Comment #17
quietone CreditAttribution: quietone at PreviousNext commentedThis extension is deprecated and scheduled for removal in Drupal 11.
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
It will be moved to the contributed extension once the Drupal 11 branch is open.
Comment #19
andypost