Regardless of the values I put in, the weighting of photo albums does not seem take effect.

Comments

pillarsdotnet’s picture

Changing album weights *does* have an effect, but not the one you expect. It changes the order of the display on taxonomy drop-down lists.

Making it affect the display order of child albums when viewing the parent album is harder than you might think.

I did some code diving and determined that the generated query needs to change from this:

SELECT
  DISTINCT(node.nid),
  node.sticky AS node_sticky
FROM
  {node} node
  LEFT JOIN {term_node} term_node ON node.nid = term_node.ni
  LEFT JOIN {term_data} term_data ON term_node.tid = term_data.tid AND term_data.vid IN ('3')
  LEFT JOIN {term_node} term_node2 ON node.nid = term_node2.nid
  LEFT JOIN {term_hierarchy} term_hierarchy ON term_node2.tid = term_hierarchy.tid
WHERE
  (term_node.tid IS NOT NULL)
  AND (term_data.tid IS NOT NULL)
  AND (term_node2.tid = '11')
GROUP BY 
  node.nid, node_sticky
ORDER BY
  node_sticky DESC,
  node.nid ASC

to this:

SELECT
  DISTINCT(node.nid),
  node.sticky AS node_sticky,
  term_data2.weight as node_weight
FROM
  {node} node
  LEFT JOIN {term_node} term_node ON node.nid = term_node.ni
  LEFT JOIN {term_data} term_data ON term_node.tid = term_data.tid AND term_data.vid IN ('3')
  LEFT JOIN {term_node} term_node2 ON node.nid = term_node2.nid
  LEFT JOIN {term_hierarchy} term_hierarchy ON term_node2.tid = term_hierarchy.tid
  LEFT JOIN {term_data} term_data2 ON node.title = term_data.name AND term_data.vid in ('3')
WHERE
  (term_node.tid IS NOT NULL)
  AND (term_data.tid IS NOT NULL)
  AND (term_node2.tid = '11')
GROUP BY 
  node.nid, node_sticky
ORDER BY
  node_sticky DESC, 
  node_weight ASC,
  node.nid ASC

Problem is, I don't know enough about views and taxonomy to determine the proper way to make the change.

I *think* the relevant function would be acidfree_album_view() in the class_album.inc file.

Either the view contents need to change before the views_build_view() call, or the arguments to that function need to change; I'm not sure which.

I think perhaps a new views handler callback function needs to be created, as well.

As a workaround, you can install the weight module, which works by overloading the "sticky" field of the node table.

mwheinz’s picture

Status: Active » Closed (won't fix)

No activity in 3 years.