I'm more or less duplicating this issue from Drupal 7 to Drupal 8.
https://www.drupal.org/project/nodeorder/issues/590622

We need to get this fixed in the D8 version, but I'm not sure how actively maintained this module is now.

Comments

xpersonas created an issue. See original summary.

joelstein’s picture

I solved this by using the "Content with term" relationship and then patching core with #2674832-3: "Content with term" views relationship not working due to wrong base table.

lubwn’s picture

Any progress in this? I am pretty much stuck. My view is easy but adding nodeorder sort filter just triples all the results. When I use aggregation I am able to reduce the number of duplicates or completelly eliminate them, but they are not ordered right as they should be. I kind of do not understand why nodeorder module does not take any arguments. Maybe adding token / relationship to noderorder would solve this problem?

lubwn’s picture

There is no other workaround currently as follows. Write your custom module and in .module file add:

use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\query\QueryPluginBase;

function YOUR_MODULE_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
	
  if ($view->id() == 'VIEW_NAME') {
	  $query->addWhereExpression(0,'taxonomy_index.tid = node__field_druh_materialu.field_druh_materialu_target_id');
  }
  
}

You need to replace node__field_druh_materialu.field_druh_materialu_target_id with a field used in node to reference a taxonomy. So for example im my case the field was "field_druh_materialu" which is a taxonomy reference field added to node content type.

xpersonas’s picture

Is this still an issue? I'm having trouble reproducing it now. Maybe I'm not understanding how the view is set up. Happy to look at it with more specific steps to reproduce.

xpersonas’s picture

Status: Active » Postponed (maintainer needs more info)