Skip to content

Upgrading To Blacklight v7.0.0.rc1

Banu Hapeloglu Kutlu edited this page Sep 25, 2018 · 1 revision
  1. Add gem 'blacklight', '~> 7.0.0.rc1' to the Gemfile
  2. $ gem install blacklight --pre
  3. $ bundle update blacklight
  4. $ bundle install
  5. $ rails generate blacklight:install --devise --marc --solr_version=7.3.0
  6. say "N" to all the solr stuff, yes to all blacklight stuff
  7. rm /Users/cdm32/Projects/psulib_blacklight/db/migrate/20180713122145_add_devise_to_users.rb
  8. $ rake db:reset db:migrate
  9. $ bundle exec solr_wrapper
  10. $ rail s

Issues we hit during upgrade:

undefined method add_show_tools_partial for CatalogController:Class

Screen_Shot_2018-07-13_at_8.35.36_AM

Fixed by adding include Blacklight::DefaultComponentConfiguration to catalog_controller.rb per release notes: https://github.com/projectblacklight/blacklight/releases/tag/v7.0.0.rc1

If you don't remove the below migration you get this:

➜  psulib_blacklight git:(blv7.0) ✗ rails db:migrate
== 20180713122145 AddDeviseToUsers: migrating =================================
-- change_table(:users)
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:

SQLite3::SQLException: duplicate column name: email: ALTER TABLE "users" ADD "email" varchar DEFAULT '' NOT NULL
/Users/cdm32/Projects/psulib_blacklight/db/migrate/20180713122145_add_devise_to_users.rb:7:in `block in up'
/Users/cdm32/Projects/psulib_blacklight/db/migrate/20180713122145_add_devise_to_users.rb:5:in `up'
/Users/cdm32/Projects/psulib_blacklight/bin/rails:9:in `require'
/Users/cdm32/Projects/psulib_blacklight/bin/rails:9:in `<top (required)>'
/Users/cdm32/Projects/psulib_blacklight/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'

Caused by:
ActiveRecord::StatementInvalid: SQLite3::SQLException: duplicate column name: email: ALTER TABLE "users" ADD "email" varchar DEFAULT '' NOT NULL
/Users/cdm32/Projects/psulib_blacklight/db/migrate/20180713122145_add_devise_to_users.rb:7:in `block in up'
/Users/cdm32/Projects/psulib_blacklight/db/migrate/20180713122145_add_devise_to_users.rb:5:in `up'
/Users/cdm32/Projects/psulib_blacklight/bin/rails:9:in `require'
/Users/cdm32/Projects/psulib_blacklight/bin/rails:9:in `<top (required)>'
/Users/cdm32/Projects/psulib_blacklight/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'

Caused by:
SQLite3::SQLException: duplicate column name: email
/Users/cdm32/Projects/psulib_blacklight/db/migrate/20180713122145_add_devise_to_users.rb:7:in `block in up'
/Users/cdm32/Projects/psulib_blacklight/db/migrate/20180713122145_add_devise_to_users.rb:5:in `up'
/Users/cdm32/Projects/psulib_blacklight/bin/rails:9:in `require'
/Users/cdm32/Projects/psulib_blacklight/bin/rails:9:in `<top (required)>'
/Users/cdm32/Projects/psulib_blacklight/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Screen_Shot_2018-07-13_at_8.30.05_AM

Undefined variable: "$padding-xs-horizontal".


Undefined variable: "$padding-xs-horizontal".```

```ActionView::Template::Error (Undefined variable: "$padding-xs-horizontal".):
    18:
    19:     <title><%= render_page_title %></title>
    20:     <%= opensearch_description_tag application_name, opensearch_catalog_url(format: 'xml') %>
    21:     <%= favicon_link_tag %>
    22:     <%= stylesheet_link_tag "application", media: "all" %>
    23:     <%= javascript_include_tag "application" %>
    24:     <%= csrf_meta_tags %>

app/assets/stylesheets/blacklight.scss:4```

~~For now fixed the below issue by overriding blacklight_marcs.scss and commenting out `padding:0 $padding-xs-horizontal;` and `padding: $nav-link-padding;`~~

Added this temporary fix to this issue for bootstrap 4 compatibility: https://github.com/projectblacklight/demo.projectblacklight.org/pull/10/files.
Clone this wiki locally