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

Customized rendering pipeline gives an error on certain Blacklight 8.x versions with zeitwerk 2.6.18 #3431

Open
sandbergja opened this issue Nov 6, 2024 · 0 comments

Comments

@sandbergja
Copy link
Contributor

sandbergja commented Nov 6, 2024

Description

If you have customized the rendering pipeline, as described in this wiki page, starting the rails app fails with uninitialized constant Blacklight::Rendering (NameError).

This works fine on Blacklight 8.3 and earlier. As long as your application is using zeitwerk 2.6.18 or higher, it works fine on Blacklight 8.6.1 as well.

Steps to recreate

  1. Check out the release-8.x branch of the Blacklight git repo
  2. Follow the step-by-step instructions to set up a local development copy of blacklight.
  3. cd into the .internal_test_app directory.
  4. Create a file config/initializers/blacklight.rb with the following content:
    Blacklight::Rendering::Pipeline.operations = [Blacklight::Rendering::HelperMethod,
                                              Blacklight::Rendering::LinkToFacet,
                                              Blacklight::Rendering::Microdata,
                                              CustomJoin]
    
  5. Then create a file app/processors/custom_join.rb with the following content:
    # Joins values using configured value or linebreak
    class CustomJoin < Blacklight::Rendering::AbstractStep
      include ActionView::Helpers::TextHelper
    
      def render
        joiner = config.join_with || '<br>'.html_safe
        next_step(safe_join(values, joiner))
      end
    end
    
  6. Then try to start the application bundle exec rails s.
  7. Note that you get uninitialized constant Blacklight::Rendering (NameError).
@sandbergja sandbergja changed the title Customized rendering pipeline gives an error on Blacklight 8.4 and higher Customized rendering pipeline gives an error on certain Blacklight 8.x versions with zeitwerk 2.6.18 Nov 6, 2024
sandbergja added a commit to pulibrary/orangelight that referenced this issue Nov 6, 2024
This allows us to use Blacklight 8.6.1.  On our current verions of zeitwerk,
Blacklight 8.6.1 gives us an uninitialized constant Blacklight::Rendering (NameError)
error when we try to start the application.

Many thanks to @cgalarza for your detective work on this issue!

Helps with #4539, since this will allow us to use 8.6.1, which fixes this bug.

See also projectblacklight/blacklight#3431
maxkadel pushed a commit to pulibrary/orangelight that referenced this issue Nov 6, 2024
This allows us to use Blacklight 8.6.1.  On our current verions of zeitwerk,
Blacklight 8.6.1 gives us an uninitialized constant Blacklight::Rendering (NameError)
error when we try to start the application.

Many thanks to @cgalarza for your detective work on this issue!

Helps with #4539, since this will allow us to use 8.6.1, which fixes this bug.

See also projectblacklight/blacklight#3431
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

No branches or pull requests

1 participant