Skip to main content
Notice removed Draw attention by CommunityBot
Bounty Ended with Cheope's answer chosen by CommunityBot
added 96 characters in body
Source Link
slhck
  • 163
  • 1
  • 11

… however tells me that those that have the "Wichtig" field not set have the value NULLNULL and therefore are sorted last. All newly created nodes get "Wichtig" set as 0, however all old ones still have NULL.

So what can I do to make those with NULL have the value '0'0 instead, and how can I prevent this for new articles in the future? and how can I prevent this for new articles in the future?

… however tells me that those that have the "Wichtig" field not set have the value NULL and therefore are sorted last.

So what can I do to make those with NULL have the value '0' instead, and how can I prevent this for new articles in the future?

… however tells me that those that have the "Wichtig" field not set have the value NULL and therefore are sorted last. All newly created nodes get "Wichtig" set as 0, however all old ones still have NULL.

So what can I do to make those with NULL have the value 0 instead and how can I prevent this for new articles in the future?

added 363 characters in body
Source Link
slhck
  • 163
  • 1
  • 11

MySQL Query Browser

… however tells me that those that have the "Wichtig" field not set have the value NULL and therefore are sorted last.

enter image description here

So what can I do to make those with NULL have the value '0' instead, and how can I prevent this for new articles in the future?

MySQL Query Browser

… however tells me that those that have the "Wichtig" field not set have the value NULL and therefore are sorted last.

enter image description here

So what can I do to make those with NULL have the value '0' instead, and how can I prevent this for new articles in the future?

added 1465 characters in body
Source Link
slhck
  • 163
  • 1
  • 11

My current settings …

In Drupal 6, I currently have a view that filters and sorts nodes by the following criteria:

enter image description here

The taxonomy term is very general, and nodes can either be assigned to "Referenzen" only, or any of its sub-nodes. This is done for the basic structuring of the site. Here, in this view though, I only want to "load all nodes with 'Referenzen' assigned", regardless of their sub-term.

enter image description here

The problem …

"Wichtig" ("important") is an integer value that defines the primary sort criteria for me. I do not care whether a reference is filed under "Media" or "Consulting", or any other sub-term.

However, the nodes are finally displayed like this:

Node 1   Important:  100   Taxonomy: Referenzen
Node 2   Important:    0   Taxonomy: Referenzen
Node 3   Important: -100   Taxonomy: Referenzen
Node 4   Important:  100   Taxonomy: Referenzen – Media
Node 5   Important:   80   Taxonomy: Referenzen – Media

As you can see, the "Important" factor comes second when sorting the nodes, and the taxonomy grouping comes first.

How can I change this behavior, so the following is achieved:How can I change this behavior, so the following is achieved:

Node 1   Important:  100   Taxonomy: Referenzen
Node 4   Important:  100   Taxonomy: Referenzen – Media
Node 5   Important:   80   Taxonomy: Referenzen – Media
Node 2   Important:    0   Taxonomy: Referenzen
Node 3   Important: -100   Taxonomy: Referenzen

The executed query

SELECT node.nid AS nid, node.title AS node_title, node.language AS node_language, node_data_field_image.field_image_fid AS node_data_field_image_field_image_fid, node_data_field_image.field_image_list AS node_data_field_image_field_image_list, node_data_field_image.field_image_data AS node_data_field_image_field_image_data, node.type AS node_type, node.vid AS node_vid, node_revisions.teaser AS node_revisions_teaser, node_revisions.format AS node_revisions_format, node_data_field_important.field_important_value AS node_data_field_important_field_important_value, node_data_field_date.field_date_value AS node_data_field_date_field_date_value 
FROM node node  
INNER JOIN term_node term_node ON node.vid = term_node.vid 
LEFT JOIN content_field_image node_data_field_image ON node.vid = node_data_field_image.vid 
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid 
LEFT JOIN content_field_important node_data_field_important ON node.vid = node_data_field_important.vid 
LEFT JOIN content_type_story node_data_field_date ON node.vid = node_data_field_date.vid 
WHERE (term_node.tid = 2) AND (node.language in ('***CURRENT_LANGUAGE***')) AND (node.status <> 0) 
ORDER BY node_data_field_important_field_important_value DESC, node_data_field_date_field_date_value DESC

The exported view

… can be downloaded here:

http://cl.ly/1c2c0X3f1Q2L3Y3x3l3w

My current settings …

In Drupal 6, I currently have a view that filters and sorts nodes by the following criteria:

enter image description here

The taxonomy term is very general, and nodes can either be assigned to "Referenzen" only, or any of its sub-nodes. This is done for the basic structuring of the site. Here, in this view though, I only want to "load all nodes with 'Referenzen' assigned", regardless of their sub-term.

enter image description here

The problem …

"Wichtig" ("important") is an integer value that defines the primary sort criteria for me. I do not care whether a reference is filed under "Media" or "Consulting", or any other sub-term.

However, the nodes are finally displayed like this:

Node 1   Important:  100   Taxonomy: Referenzen
Node 2   Important:    0   Taxonomy: Referenzen
Node 3   Important: -100   Taxonomy: Referenzen
Node 4   Important:  100   Taxonomy: Referenzen – Media
Node 5   Important:   80   Taxonomy: Referenzen – Media

As you can see, the "Important" factor comes second when sorting the nodes, and the taxonomy grouping comes first.

How can I change this behavior, so the following is achieved:

Node 1   Important:  100   Taxonomy: Referenzen
Node 4   Important:  100   Taxonomy: Referenzen – Media
Node 5   Important:   80   Taxonomy: Referenzen – Media
Node 2   Important:    0   Taxonomy: Referenzen
Node 3   Important: -100   Taxonomy: Referenzen

My current settings …

In Drupal 6, I currently have a view that filters and sorts nodes by the following criteria:

enter image description here

The taxonomy term is very general, and nodes can either be assigned to "Referenzen" only, or any of its sub-nodes. This is done for the basic structuring of the site. Here, in this view though, I only want to "load all nodes with 'Referenzen' assigned", regardless of their sub-term.

enter image description here

The problem …

"Wichtig" ("important") is an integer value that defines the primary sort criteria for me. I do not care whether a reference is filed under "Media" or "Consulting", or any other sub-term.

However, the nodes are finally displayed like this:

Node 1   Important:  100   Taxonomy: Referenzen
Node 2   Important:    0   Taxonomy: Referenzen
Node 3   Important: -100   Taxonomy: Referenzen
Node 4   Important:  100   Taxonomy: Referenzen – Media
Node 5   Important:   80   Taxonomy: Referenzen – Media

As you can see, the "Important" factor comes second when sorting the nodes, and the taxonomy grouping comes first.

How can I change this behavior, so the following is achieved:

Node 1   Important:  100   Taxonomy: Referenzen
Node 4   Important:  100   Taxonomy: Referenzen – Media
Node 5   Important:   80   Taxonomy: Referenzen – Media
Node 2   Important:    0   Taxonomy: Referenzen
Node 3   Important: -100   Taxonomy: Referenzen

The executed query

SELECT node.nid AS nid, node.title AS node_title, node.language AS node_language, node_data_field_image.field_image_fid AS node_data_field_image_field_image_fid, node_data_field_image.field_image_list AS node_data_field_image_field_image_list, node_data_field_image.field_image_data AS node_data_field_image_field_image_data, node.type AS node_type, node.vid AS node_vid, node_revisions.teaser AS node_revisions_teaser, node_revisions.format AS node_revisions_format, node_data_field_important.field_important_value AS node_data_field_important_field_important_value, node_data_field_date.field_date_value AS node_data_field_date_field_date_value 
FROM node node  
INNER JOIN term_node term_node ON node.vid = term_node.vid 
LEFT JOIN content_field_image node_data_field_image ON node.vid = node_data_field_image.vid 
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid 
LEFT JOIN content_field_important node_data_field_important ON node.vid = node_data_field_important.vid 
LEFT JOIN content_type_story node_data_field_date ON node.vid = node_data_field_date.vid 
WHERE (term_node.tid = 2) AND (node.language in ('***CURRENT_LANGUAGE***')) AND (node.status <> 0) 
ORDER BY node_data_field_important_field_important_value DESC, node_data_field_date_field_date_value DESC

The exported view

… can be downloaded here:

http://cl.ly/1c2c0X3f1Q2L3Y3x3l3w

Notice added Draw attention by slhck
Bounty Started worth 50 reputation by slhck
Tweeted twitter.com/#!/StackDrupal/status/119034236832448512
Source Link
slhck
  • 163
  • 1
  • 11
Loading