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

Staff search should be able to find eprints without metadata_visibility = 'show' #299

Closed
drn05r opened this issue Feb 22, 2023 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@drn05r
Copy link
Contributor

drn05r commented Feb 22, 2023

If you try to find an eprint using staff search (Search Items in Admin menu) then you won't be able to find it even if you search in its specific eprintid if it does not have metadata_visibility = 'show'.

Staff search should be able to find all items as admins may need to make amendments to older versions of eprints that have been succeeded.

@drn05r drn05r added the bug Something isn't working label Feb 22, 2023
@drn05r drn05r added this to the 3.4.5 milestone Feb 22, 2023
@drn05r drn05r self-assigned this Feb 22, 2023
@Ainmhidh
Copy link

Either ignore the metadata_visibility where the search criteria includes an eprintid or, as drn05r suggested on the tech-list, have a checkbox to ignore hide status in admin search.

@drn05r
Copy link
Contributor Author

drn05r commented Feb 22, 2023

@Ainmhidh The main issue is that the metadata_visibility = 'show' looks quite baked into the search API. Maybe when I look a little deeper there is a nice flag to tell the search API to ignore metadata_visibility. Obvioulsy, care needs to be taken to make sure that metadata_visibility restriction for public search is not broken by any changes.

@yurj
Copy link

yurj commented Feb 22, 2023

Are there any other use of metadata_visibility? I mean, other eprints that have it on hide other than older versions.

@drn05r
Copy link
Contributor Author

drn05r commented Feb 22, 2023

@yurj So the metadata_visibility can be one of three values: hide, show or no_search. I think in your old version situation the item will have had metadata_visibility set to no_search. There are not any other scenarios in the codebase that I can see where metadata_visibility is modified to something other than show. However, I think bespoke additions may have made use of this as well as third party applications, I know Symplectic Elements heavily used versioning for EPrints' Repository Tools 1 (RT1) plugin.

I have to admit that scenarios where you want to hide the metadata but still be able to access the abstract page would be rare. As metadata_visibility does not modify robots.txt or say anything on the abstract page to stop Google and its like indexing such abstract pages.

@yurj
Copy link

yurj commented Feb 22, 2023

I've implemented your suggestion in cgi/search:

if( $dataset->base_id eq "eprint" && $searchid ne "staff" )
{
        push @filters,
                { meta_fields => ["metadata_visibility"], value => "show" };
}

@drn05r drn05r closed this as completed in 428744e Feb 24, 2023
drn05r added a commit that referenced this issue Feb 24, 2023
drn05r added a commit that referenced this issue Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants