-
Notifications
You must be signed in to change notification settings - Fork 253
Upgrading to Blacklight 9
Blacklight 9 includes some backwards-incompatible changes. Follow this guide to upgrade a Blacklight 8 application to Blacklight 9.
-
Ensure your local application has a passing test suite. If needed, add automated tests for any important functionality, to make it obvious when something is broken.
-
Upgrade to the latest 8.x release so you can see any recent deprecation warnings.
-
Take note of any deprecation warnings originating from Blacklight in the logs and make the suggested changes.
-
Upgrade to Blacklight 9 and follow the Upgrade Notes below.
To test a plugin and validate it Run the plugin with the latest version of blacklight/main.
- blacklight-hierarchy
- blacklight_range_limit - Tested and working in blacklight 9.x pre-releases as of blacklight_range_limit 9.0
- blacklight_dynamic_sitemap
- blacklight-gallery
- arclight https://github.com/projectblacklight/arclight/pull/1596 (needs a release cut)
- blacklight_oai_provider
- blacklight_iiif_search
- blacklight_advanced_search - release needed
- geoblacklight - a number of UI issues, in progress PR open
-
The
shared/header_navbarpartial no longer exists. If you used this in your application, thenrender blacklight_config.header_component.new(blacklight_config: blacklight_config)instead. -
The
catalog/constraintspartial no longer exists. If you call this in your application, insteadrender blacklight_config.view_config(document_index_view_type).constraints_component.new(search_state: search_state) -
If you use importmap-rails to access Blacklight Javascript files, change the line
import 'blacklight'toimport 'blacklight-frontend'. (probably in anapplication.jsfile) -
If you used to use
import 'blacklight-frontend/app/assets/javascripts/blacklight/blacklight', it should now be switched toimport 'blacklight-frontend' -
For SCSS, if you used to
@import 'blacklight-frontend/app/assets/stylesheets/blacklight/blacklight';, it should now be switched to@import 'blacklight-frontend/stylesheets/blacklight';. -
Blacklight::Document::EmailandBlacklight::Document::Smshave been removed. You may need to modify yourapp/models/solr_document.rbto remove theuse_extensionfor these. -
Blacklight::ConstraintComponentnow accepts aBlacklight::ClausePresenter, rather than aBlacklight::FacetItemPresenter -
Blacklight::DocumentComponent's initializer no longer accepts a presenter parameter. Instead, pass aBlacklight::DocumentPresenterto the document parameter. -
Blacklight::DocumentTitleComponent's initializer no longer accepts a document parameter. Instead, pass aBlacklight::DocumentPresenterto the presenter parameter. -
Bootstrap 5 is now required. BL8 supported BS4 & BS5, but Bootstrap 4 reached EOL in Jan 2023. If you are upgrading from a Bootstrap 4 app, please consult Bootstrap's Migrating to v5 docs. Pay extra attention to all the changes there tagged as
breaking(there are many). -
Customizing CSS. Following Bootstrap's CSS evolution, a Blacklight 9 application's styles can be customized without requiring Sass compilation. Previous BL8 Sass variables like
$logo-widthhave now been moved to native CSS custom properties (variables) likevar(--bl-logo-width). See Blacklight's compiled blacklight.css file and Bootstrap's compiled bootstrap.css file to see available variables. Note that Bootstrap variables are prefixed withbs-*and Blacklight variables havebl-*. -
Advanced Search. Blacklight's native/built-in advanced search (available at
/catalog/advanced) is now enabled by default in BL9. If you were using it in BL8, you may have had to add some workarounds to get it to work correctly with different versions of Solr. You can likely remove those workarounds in BL9. Update yourCatalogControllerwith the advanced search changes made to BL9's catalog_controller.rb template used in the generator.
- To turn off advanced search, set
config.advanced_search.enabled = false - If you had created a separate Solr
advancedrequestHandler for BL8, you can likely remove it and use the defaultconfig.json_solr_path = 'select' - In your facet field configuration, add
include_in_advanced_search: falsefor any field that you don't want to appear in the advanced search form - If you had added
field.clause_params = { edismax: field.solr_parameters.dup }to any facet field config to support advanced search in BL8, you can now remove it; the correctclause_paramswill now be automatically set correctly. - The default advanced search will display all facet fields, and all possible values for each (
limit: -1). If any field has too many values for this to be practical, you might consider A) suppressing it withinclude_in_advanced_search: false; B) setting a specificlimitusingconfig.advanced_search.form_solr_parameters; C) adding a custom view and JS for multi-select facets. - See #3742 for more details.