jywarren / plots

This is the old website for Public Lab; visit http://publiclab.org and https://github.com/publiclab/plots2 for the new website.
http://old.publiclab.org
12 stars 0 forks source link

Related Research Notes doesn't show on Tool and Place pages for most users #14

Closed jywarren closed 12 years ago

jywarren commented 12 years ago

I hammered on this for 2 hours, no luck:

//return "gulf-coast";

$src = arg(0) ."/". arg(1); // select the url alias from the url_alias table $sql = "SELECT dst FROM {url_alias} WHERE src = '%s'"; $path = db_result(db_query(db_rewrite_sql($sql), $src));

// I don't need the part of the string before the first / $patharray = explode("/", $path);

if (($patharray[0] == 'place' || $patharray[0] == 'tool') && $patharray[1] != '') { return $patharray[1]; }


yields:

Unknown column 'n.nid' in 'on clause' query: SELECT DISTINCT dst FROM url_alias INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 6 AND na.realm = 'private_author') OR (na.gid = 6 AND na.realm = 'to_do_author') OR (na.gid = 6 AND na.realm = 'to_do_assignee') OR (na.gid = 2 AND na.realm = 'to_do_access_content'))) AND ( src = 'node/178') in /home/warren/sites/publiclaboratory.org/html/modules/views/plugins/views_plugin_argument_default_php.inc(48) : eval()'d code on line 6.


This rewrite didn't help:

//return "gulf-coast";

$src = arg(0) ."/". arg(1); $node = node_load(arg(1));

// select the url alias from the url_alias table $path = drupal_lookup_path('alias',"node/".$node->nid)

// I don't need the part of the string before the first / $patharray = split("/", $path);

if (($patharray[0] == 'place' || $patharray[0] == 'tool') && $patharray[1] != '') { return $patharray[1]; }

jywarren commented 12 years ago

It's all centered on the Arguments in the view, where we have to supply a taxonomy term to the block so it can find the right research notes.