I'm trying to get Potlatch2 setup as the default editor on our OSMCP server (<a href="http://navigator.er.usgs.gov">navigator.er.usgs.gov</a>). We built the site using a snapshot of the OSM code from May 14, 2010. I've setup Potlatch2 in the rails/public/p2 directory (you can hit it via <a href="http://navigator.er.usgs.gov/p2/potlatch2.html">navigator.er.usgs.gov/p2/potlatch2.html</a>). I've been able to configure Oauth to work with that URL. To get it to work on the Edit tab, I cut the code out of /app/views/site/_potlatch2.html.erb and pasted it over the old code in /app/views/site/index.html.erb. I don't want to let the user select between Potlatch 1 & 2 - just take them straight to 2.<div>
<br></div><div>I've gone through as much of the Rails app as I can seem to track down (I'm a Rails n00b) and updated everything related to oauth. I noticed in OSM, on my "oauth settings" I've got "Potlatch2" list as a "token issued in my name". On my site, I can't figure out how to issue Oauth tokens.</div>
<div><br></div><div>When I try to open the editor, I get the following error:</div><div><br></div><div><div style="background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; ">
<h1>NameError in Site#edit</h1><p style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; ">Showing <i>app/views/site/edit.html.erb</i> where line <b>#83</b> raised:</p><pre style="background-color: rgb(238, 238, 238); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 11px; ">
<code>undefined local variable or method `token' for #<ActionView::Base:0x7fcbb1a1b358></code></pre><p style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; "></p><p style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; ">
Extracted source (around line <b>#83</b>):</p><pre style="background-color: rgb(238, 238, 238); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 11px; "><code>80: fo.addVariable("api","<%= request.protocol + request.host_with_port %>/api/<%= API_VERSION %>/");
81: fo.addVariable("policy","<%= request.protocol + request.host_with_port %>/api/crossdomain.xml");
82: fo.addVariable("connection","XML");
83: fo.addVariable("oauth_token","<%= token.token %>");
84: fo.addVariable("oauth_token_secret","<%= token.secret %>");
85: fo.addVariable("oauth_consumer_key","<%= token.client_application.key %>");
86: fo.addVariable("oauth_consumer_secret","<%= token.client_application.secret %>");
</code></pre><p style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; "></p><p style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; "></p>
<p style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; "><code>RAILS_ROOT: /osmcp/rails</code></p><div id="traces"><a href="http://navigator.er.usgs.gov/edit#" style="color: rgb(0, 0, 0); ">Application Trace</a> | <a href="http://navigator.er.usgs.gov/edit#" style="color: rgb(0, 0, 0); ">Framework Trace</a> | <a href="http://navigator.er.usgs.gov/edit#" style="color: rgb(0, 0, 0); ">Full Trace</a><div id="Application-Trace" style="display: block; ">
<pre style="background-color: rgb(238, 238, 238); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 11px; "><code>/osmcp/rails/app/views/site/edit.html.erb:83:in `_run_erb_app47views47site47edit46html46erb'</code></pre>
</div></div><h2 style="margin-top: 30px; ">Request</h2><p style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; "><b>Parameters</b>:</p><pre style="background-color: rgb(238, 238, 238); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 11px; ">
None</pre><p style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; "></p><p style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; "><a href="http://navigator.er.usgs.gov/edit#" style="color: rgb(0, 0, 0); ">Show session dump</a></p>
<h2 style="margin-top: 30px; ">Response</h2><p style="font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; "><b>Headers</b>:</p><pre style="background-color: rgb(238, 238, 238); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 11px; ">
{"Vary"=>"*",
"Content-Language"=>"en",
"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></div></div><div><br></div><div>Thoughts? I've been spinning my wheels on this for a couple hours.</div><div><br></div><div>-Eric</div><div><br clear="all">-=--=---=----=----=---=--=-=--=---=----=---=--=-=-<br>
Eric B. Wolf 720-334-7734<br><br><br><br>
</div>