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

Dashboard Statistics generates NoMethodError (nurax-pg) #5592

Closed
eporter23 opened this issue Mar 31, 2022 · 5 comments
Closed

Dashboard Statistics generates NoMethodError (nurax-pg) #5592

eporter23 opened this issue Mar 31, 2022 · 5 comments

Comments

@eporter23
Copy link
Contributor

Descriptive summary

Hyrax 3.3 for nurax-pg: when logged as in administrator, trying to view the Statistics (reports) section of the dashboard returns an error.

Rationale

For maintaining current Hyrax functionality, admin users should be able to access the Statistics section of the dashboard.

Expected behavior

Admin user can see summary statistics and date range selection options

Actual behavior

NoMethodError page is shown

Steps to reproduce the behavior

  1. Login as an admin-level user
  2. Go to the Dashboard and look at the Activity section
  3. Click on Statistics in the left column
  4. See error page

Screen Shot 2022-03-31 at 1 23 30 PM

Screen Shot 2022-03-31 at 1 24 13 PM

Equivalent page in nurax-dev:
Screen Shot 2022-03-31 at 1 25 49 PM

@jlhardes
Copy link
Contributor

Remaining work on #3820 - Replace calls to ActiveFedora::Base.where (removes 7 refs to ActiveFedora) might be needed for this issue

@blancoj blancoj self-assigned this Sep 14, 2022
@bkiahstroud
Copy link
Contributor

The errors described in this ticket seems to ultimately trace back to Hyrax::AbstractTypeRelation. This class explicitly inherits from ActiveFedora::Relation.

The purpose of the Hyrax::AbstractTypeRelation class, as far as I can tell, is primarily scoping Solr queries. The only thing I'm not sure about is DummyModel.delegated_attributes; I'm not sure what that's used for, but either way it seems very ActiveFedora-specific.

I think this whole file could be refactored to use Valkyrie query services.

An observation I had was that a lot of code that uses AbstractTypeRelation and its subclasses hasn't been touched in several years, so there might be a case for just removing this logic if it isn't needed anymore. I don't personally have enough context to say definitively though.

Any guidance on how to move forward is appreciated.

@summer-cook summer-cook self-assigned this Jun 2, 2023
@dlpierce
Copy link
Contributor

dlpierce commented Jun 2, 2023

I agree, it could be refactored to use valkyrie. The WorkRelation subclass is used in a variety of places in Hyrax, so not something that can be retired. Creating a full valkyrie refactor that includes all of the features of AF::Relation is probably not needed if we can identify which methods are actually used. That seems to be #search_in_batches, #find, #search_with_conditions, #find_each, #where ?

WorkQueryService uses WorkRelation and has WorkResourceQueryService as a valkyrie replacement. Perhaps the other uses can be substituted similarly? Another thought is can some valkyrie custom queries be the replacement?

I think delegated_attributes is a list of methods that can be set by the model that should be listed and accessible in the same way as standard model attributes.

@crisr15
Copy link

crisr15 commented Jul 21, 2023

This ticket is on hold until the GA4 work is complete, as it is currently not working in hyrax main.

@jlhardes
Copy link
Contributor

Viewing Statistics as an admin from the Dashboard is working in Hyrax 5.0.0 on both https://dev.nurax.samvera.org/ and https://pg.nurax.samvera.org/. There are no errors and date range filters work as well.

@rjkati rjkati closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants