From 3d7e311451f4f8f7c7118b9faa8ae85ca5f17965 Mon Sep 17 00:00:00 2001 From: David Read Date: Tue, 4 Jul 2017 11:54:32 +0100 Subject: [PATCH 1/2] Fix solr multicore not persisting restarts. --- doc/contributing/test.rst | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/doc/contributing/test.rst b/doc/contributing/test.rst index b10d71744b9..11bfa226233 100644 --- a/doc/contributing/test.rst +++ b/doc/contributing/test.rst @@ -71,12 +71,13 @@ Configure Solr Multi-core ~~~~~~~~~~~~~~~~~~~~~~~~~ The tests assume that Solr is configured 'multi-core', whereas the default -Solr set-up is often 'single-core'. You can ask Solr how many cores it has -configured:: +Solr set-up is often 'single-core'. You can ask Solr for its cores status:: curl -s 'http://127.0.0.1:8983/solr/admin/cores?action=STATUS' |python -c 'import sys;import xml.dom.minidom;s=sys.stdin.read();print xml.dom.minidom.parseString(s).toprettyxml()' -You can also tell from your ckan config:: +Each core will be within a child from the ```` element. + +You can also tell from your ckan config (assuming ckan is working):: grep solr_url /etc/ckan/default/production.ini # single-core: solr_url = http://127.0.0.1:8983/solr @@ -92,13 +93,22 @@ To enable multi-core: sudo cp -r /usr/share/solr/ /etc/solr/ckan -3. Configure Solr with the new core:: +3. Find your solr.xml. It is in the Solr Home directory given by this command:: + + curl -s 'http://127.0.0.1:8983/solr/admin/' | grep SolrHome + +4. Configure Solr with the new core by editing ``solr.xml``. The 'cores' section will have one 'core' in it already and needs the second one 'ckan' added so it looks like this:: + + + + + - curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=ckan&instanceDir=/etc/solr/ckan' +5. Restart Solr by restarting Jetty (or Tomcat):: - If successful the status should be 0 - some XML containing: ``0`` + sudo service jetty restart -4. Edit your main ckan config (e.g. |development.ini|) and adjust the solr_url to match:: +6. Edit your main ckan config (e.g. |development.ini|) and adjust the solr_url to match:: solr_url = http://127.0.0.1:8983/solr/ckan From 8e194fa49db409db68fcce77eae2eb9e7280ab42 Mon Sep 17 00:00:00 2001 From: Konstantin Sivakov Date: Thu, 6 Jul 2017 16:13:17 +0200 Subject: [PATCH 2/2] fix radio button PR --- ckan/lib/helpers.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py index e7bf1c9d496..562adf7e39a 100644 --- a/ckan/lib/helpers.py +++ b/ckan/lib/helpers.py @@ -2342,6 +2342,15 @@ def mail_to(email_address, name): return html +@core_helper +def radio(selected, id, checked): + if checked: + return literal((u'') % (selected, id, selected, id)) + return literal(('') % (selected, id, selected, id)) + + core_helper(flash, name='flash') core_helper(localised_number) core_helper(localised_SI_number) @@ -2362,6 +2371,7 @@ def mail_to(email_address, name): core_helper(urlencode) core_helper(clean_html, name='clean_html') + def load_plugin_helpers(): """ (Re)loads the list of helpers provided by plugins.