Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings due to upgrade #774

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from
Draft

Conversation

laritakr
Copy link
Collaborator

Add gem to record deprecations.
run via DEPENDENCIES_NEXT=1 DEPRECATION_BEHAVIOR="record" bundle exec rspec

ref: scientist-softserv#61

laritakr and others added 8 commits August 18, 2023 16:54
Add gem to record deprecations.
run: DEPENDENCIES_NEXT=1 DEPRECATION_BEHAVIOR="record" bundle exec rspec

ref: scientist-softserv#61
This commit puts the 5.1 conditional around the DeprecationToolkit
configurations.
This commit will address a warning where
`digital_instantiation_attributes[:main_title]` is `nil` and that will
always be true.  Instead, we set the `main_title` value in the
`digital_instantiation_attributes` so it checks for a string instead.
This commit will change `@push.errors.values` to
`@push.errors.map(&:values)` because `ActiveModel::Errors#values` is
being deprecated in Rails 7.0.
This commit addresses the following warning:

```
DEPRECATION WARNING: Initializing a
Blacklight::Configuration::ViewConfig implicitly (by calling gallery) is
deprecated. Call it as gallery! or pass initialize arguments. (called
from block in <class:CatalogController> at
/app/samvera/hyrax-webapp/app/controllers/catalog_controller.rb:18)
DEPRECATION WARNING: Initializing a
Blacklight::Configuration::ViewConfig implicitly (by calling masonry) is
deprecated. Call it as masonry! or pass initialize arguments. (called
from block in <class:CatalogController> at
/app/samvera/hyrax-webapp/app/controllers/catalog_controller.rb:19)
DEPRECATION WARNING: Initializing a
Blacklight::Configuration::ViewConfig implicitly (by calling slideshow)
is deprecated. Call it as slideshow! or pass initialize arguments.
(called from block in <class:CatalogController> at
/app/samvera/hyrax-webapp/app/controllers/catalog_controller.rb:20)
```
This commit will fix the following deprecation:

```
DEPRECATION WARNING: render_hash_as_hidden_fields is deprecated and will
be removed from a future release (Use
Blacklight::HiddenSearchStateComponent instead).
```
This commit will move the `#search_fields` and `#thumbnail_url` methods
from the Blacklight to the `ApplicationHelper` to avoid the deprecation
warning.

If we ever upgrade to Blacklight 8, the way the facets and the date
range filter might have to be changed.  It is already a lot different in
Blacklight 7 but it still seems to work at least.
unless App.rails_5_1?
DeprecationToolkit::Configuration.config do |config|
config.test_runner = :rspec
config.warnings_treated_as_deprecation = [//]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line so that it excludes deprecation warnings from gems

@laritakr laritakr marked this pull request as ready for review August 21, 2023 15:40
@ShanaLMoore
Copy link
Collaborator

Marking WIP pr as draft for now. We will revisit it in scientist-softserv#61

@ShanaLMoore ShanaLMoore marked this pull request as draft August 21, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants