<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #1246: Search results on ckan.net are mistakenly all 'open'</title>
    <link>http://localhost/ticket/1246</link>
    <description>&lt;p&gt;
All package search results on ckan.net are labelled as 'open' even when their license is closed or unknown: &lt;a class="ext-link" href="http://ckan.net/package"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://ckan.net/package&lt;/a&gt;
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>CKAN</title>
      <url>http://assets.okfn.org/p/ckan/img/ckan_logo_shortname.png</url>
      <link>http://localhost/ticket/1246</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Thu, 28 Jul 2011 14:33:03 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/1246#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/1246#comment:1</guid>
      <description>
        &lt;p&gt;
We have an unresolved issue with the display of the 'open data' icon that showed up when we upgraded ckan.net to the latest beta last week, but I didn't realise the search page &lt;a class="ext-link" href="http://ckan.net/package"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://ckan.net/package&lt;/a&gt; was showing all packages as open (the revision page and package pages seem fine).
&lt;/p&gt;
&lt;p&gt;
Last week when I upgraded from 1.4.1 to 1.4.2beta, there was an exception thrown when loading the home page. The exception was in doing the isopen call. It was solved by making some code changes directly on the ckan.net server to make it an attribute query instead of function call. It was strange because this behaviour didn't occur on my machine and all the tests passed. Here are the manual patches on ckan.net (the application.js change is unrelated, by someone else):
&lt;/p&gt;
&lt;pre class="wiki"&gt;
diff -r adf254b7c507 ckan/public/scripts/application.js
--- a/ckan/public/scripts/application.js	Sat Jul 23 18:16:15 2011 +0100
+++ b/ckan/public/scripts/application.js	Thu Jul 28 14:10:23 2011 +0000
@@ -2,6 +2,7 @@
   $(document).ready(function () {
     CKAN.Utils.setupUserAutocomplete($('input.autocomplete-user'));
     CKAN.Utils.setupAuthzGroupAutocomplete($('input.autocomplete-authzgroup'));
+    // $('.resource-url').parent(
   });
 }(jQuery));
diff -r adf254b7c507 ckan/templates/_util.html
--- a/ckan/templates/_util.html	Sat Jul 23 18:16:15 2011 +0100
+++ b/ckan/templates/_util.html	Thu Jul 28 14:10:23 2011 +0000
@@ -43,7 +43,7 @@
         standard package listing --&amp;gt;
   &amp;lt;ul py:def="package_list(packages)" class="packages"&amp;gt;
     &amp;lt;li py:for="package in packages"
-        class="${'fullyopen' if (package.isopen() and package.resources) else None}"&amp;gt;
+        class="${'fullyopen' if (package.isopen and package.resources) else None}"&amp;gt;
         &amp;lt;div class="header"&amp;gt;
 			&amp;lt;span class="title"&amp;gt;
 				${h.link_to(package.title or package.name, h.url_for(controller='package', action='read', id=package.name))}
@@ -60,7 +60,7 @@
           &amp;lt;/ul&amp;gt;
         &amp;lt;/py:if&amp;gt;
         &amp;lt;ul class="openness"&amp;gt;
-          &amp;lt;py:if test="package.isopen()"&amp;gt;
+          &amp;lt;py:if test="package.isopen"&amp;gt;
             &amp;lt;li&amp;gt;
               &amp;lt;a href="http://opendefinition.org/okd/" title="This package satisfies the Open Definition."&amp;gt;
                   &amp;lt;img src="http://assets.okfn.org/images/ok_buttons/od_80x15_blue.png" alt="[Open Data]" /&amp;gt;
@@ -72,7 +72,7 @@
               &amp;lt;/a&amp;gt;
             &amp;lt;/li&amp;gt;
           &amp;lt;/py:if&amp;gt;
-          &amp;lt;py:if test="not package.isopen()"&amp;gt;
+          &amp;lt;py:if test="not package.isopen"&amp;gt;
             &amp;lt;li&amp;gt;
               &amp;lt;span class="closed"&amp;gt;
                 ${h.icon('lock')} Not Openly Licensed
diff -r adf254b7c507 ckan/templates/home/index.html
--- a/ckan/templates/home/index.html	Sat Jul 23 18:16:15 2011 +0100
+++ b/ckan/templates/home/index.html	Thu Jul 28 14:10:23 2011 +0000
@@ -64,6 +64,7 @@
     &amp;lt;/py:if&amp;gt;
     &amp;lt;h4&amp;gt;Recently changed packages&amp;lt;/h4&amp;gt;
+    &amp;lt;!-- ${c.latest_packages} --&amp;gt;
     ${package_list_from_dict(c.latest_packages)}
     &amp;lt;p&amp;gt;&amp;lt;a href="${h.url_for(controller='revision', action='index',
diff -r adf254b7c507 ckan/templates/layout_base.html
--- a/ckan/templates/layout_base.html	Sat Jul 23 18:16:15 2011 +0100
+++ b/ckan/templates/layout_base.html	Thu Jul 28 14:10:23 2011 +0000
@@ -101,6 +101,7 @@
     am_authorized_package_create = h.am_authorized(c, actions.PACKAGE_CREATE)
 ?&amp;gt;
           &amp;lt;li py:if="am_authorized_package_create"&amp;gt;${h.nav_link(c, _('Add a package'), controller='package', action='new', id=None)}&amp;lt;/li&amp;gt;
+          &amp;lt;li&amp;gt;&amp;lt;a href="/storage/upload"&amp;gt;Upload Data&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
           &amp;lt;li&amp;gt;${h.nav_link(c, _('Tags'), controller='tag', action='index', id=None)}&amp;lt;/li&amp;gt;
           &amp;lt;li&amp;gt;${h.nav_link(c, _('Groups'), controller='group', action='index', id=None, highlight_actions = 'new index')}&amp;lt;/li&amp;gt;
           &amp;lt;li&amp;gt;${h.nav_link(c, _('About'), controller='home', action='about', id=None)}&amp;lt;/li&amp;gt;
diff -r adf254b7c507 ckan/templates/package/read.html
--- a/ckan/templates/package/read.html	Sat Jul 23 18:16:15 2011 +0100
+++ b/ckan/templates/package/read.html	Thu Jul 28 14:10:23 2011 +0000
@@ -56,7 +56,7 @@
     &amp;lt;/py:if&amp;gt;
     &amp;lt;li class="widget-container widget_text"&amp;gt;
-    &amp;lt;py:if test="c.pkg.isopen() and c.pkg.resources"&amp;gt;
+    &amp;lt;py:if test="c.pkg.isopen and c.pkg.resources"&amp;gt;
       &amp;lt;h3&amp;gt;
         This Package is Open
       &amp;lt;/h3&amp;gt;
@@ -80,7 +80,7 @@
       &amp;lt;/p&amp;gt;
     &amp;lt;/py:if&amp;gt;
-    &amp;lt;py:if test="not(c.pkg.isopen() and c.pkg.resources)"&amp;gt;
+    &amp;lt;py:if test="not(c.pkg.isopen and c.pkg.resources)"&amp;gt;
       &amp;lt;h3 i18n:msg=""&amp;gt;This package is Not Open&amp;lt;/h3&amp;gt;
       &amp;lt;p&amp;gt;Either because it is not openly licensed or is missing
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>pudo</dc:creator>

      <pubDate>Thu, 28 Jul 2011 20:36:00 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/1246#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/1246#comment:2</guid>
      <description>
        &lt;p&gt;
I'm afraid to say I don't understand any of this: the faulty display of openness is triggered as removing the brackets turns the isopen() check into a check for the existence of the method. Reverting the changes on the server seems to work without generating exceptions. What exactly is the issue that was supposed to be fixed originally?
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>pudo</dc:creator>

      <pubDate>Thu, 28 Jul 2011 22:40:16 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>http://localhost/ticket/1246#comment:3</link>
      <guid isPermaLink="false">http://localhost/ticket/1246#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>