Skip to content

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

Open
@sandbergja

Description

@sandbergja

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions