Closed jesusbagpuss closed 3 months ago
NB I'll submit a possible fix for this in a mo'.
Surely you just need to pass the $searchexp
as well?
Yes - and remove the intersect.
My proposal passes the %opts
, but I think having an 'actual' method (similar to some MetaFields) would make using the config function cleaner/easier.
See: https://github.com/eprints/eprints3.4/compare/master...jesusbagpuss:eprints3.4:issue-395?expand=1
I wasn't sure where the best place to put the example function was - in an extension, I'd add a blah.pl.example
file, but in the core, I guessed adding it to the documentation was right.
I have added description of all potential configuration options that do not appear in files at:
https://wiki.eprints.org/w/Miscellaneous_Config_Options
This includes get_users_owned_eprints
. I don't think this wiki page is necessary a good place to add example functions but maybe create a sub page like:
https://wiki.eprints.org/w/Miscellaneous_Config_Options/get_users_owned_eprints
The User dataobject references a
get_users_owned_eprints
config method that can control the items considered 'owned' by a user: https://github.com/eprints/eprints3.4/blob/e08862948a02c4c3fde5acba50af1976b0031d5f/perl_lib/EPrints/DataObj/User.pm#L941-L966If this method is defined, the status checkboxes on the Items page break, and all items are displayed.
To recreate, add the following to
~/archives/ARCHIVEID/cfg/cfg.d/z_get_users_owned_eprints.pl
If you log in as a normal (non-editor) user, on the Manage deposits page, the status-filter checkboxes no longer work.
The solution is to pass the %opts hash into the config method, but I think it might be worth abstracting the default behaviour to a
get_users_owned_eprints_actual
method, so retaining the default behaviour for some cases is easier.