EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #09086
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] Document field title/help-text using a phrase in workflow
- To: <eprints-tech@ecs.soton.ac.uk>, John Salter <J.Salter@leeds.ac.uk>
- Subject: Re: [EP-tech] Document field title/help-text using a phrase in workflow
- From: David R Newman <drn@ecs.soton.ac.uk>
- Date: Wed, 5 Oct 2022 09:33:25 +0100
Hi John,
I found a similar issue in EPrints 3.4 (which will almost certainly also be a problem in 3.3) with reusing the same pin twice within a phrase and I fixed this in 3.4 a couple of years back:
https://github.com/eprints/eprints3.4/issues/109
This looks to be a similar issue for titles and help texts of fields so the place to fix this is on the following two lines:
https://github.com/eprints/eprints3.4/blob/master/perl_lib/EPrints/MetaField.pm#L423
https://github.com/eprints/eprints3.4/blob/master/perl_lib/EPrints/MetaField.pm#L477
I propose changing these respectively to:
return EPrints::XML::clone_node(
$self->{title_xhtml}, 1 );
return EPrints::XML::clone_node( $self->{help_xhtml}, 1 );
What are you thoughts on such a change. It is quite uncommon to use the <help> and <title> tags for fields within a workflow, (especially document sub-fields), so cloning the node should not normally be expensive either memory or processing time wise. Therefore, although there may be a more efficient solution, this feels like the most straightforward resolution whilst not excessively expensive.
Regards
David Newman
CAUTION: This e-mail originated outside the University of Southampton.Hi,
I've just observed some curious behaviour in EPrints 3.3.16, and wondered whether it also impacts 3.4.x (don't have a test system at hand to try it out at the moment).
In the default eprint workflow, in the 'files' stage, if you define a document field title or help-text using a phrase, it doesn't get rendered for the second (or more) document.To re-create:
- upload two documents to an eprint.
- In the workflow, change the default field spec:
- <field ref="license"/>
- to use a phrase for the help-text:
- <field ref="license">
- <help><epc:phrase ref="archive_name"/></help>
- </field>
- re-load the 'Upload' workflow - the 'show help' icon is not rendered for the licence field for the second document (see screenshot below)
If you embed text directly into the workflow (bad practice!)
<help>This is some help text</help>it appears to work OK.
I think the issue is with the caching of the html_xhtml field property in EPrint::MetaField.
I've traced the help-text back to:
https://github.com/eprints/eprints/blob/master/perl_lib/EPrints/Plugin/InputForm/Component.pm#L496-L503
(v3.4 equivalent: https://github.com/eprints/eprints3.4/blob/master/perl_lib/EPrints/Plugin/InputForm/Component.pm#L450-L457 )
and I suspect the issue may lie with this 'clone':(v3.4 equivalent: https://github.com/eprints/eprints3.4/blob/master/perl_lib/EPrints/Plugin/InputForm/Component.pm#L481 )
Cheers,John
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech *** Archive: http://www.eprints.org/tech.php/ *** EPrints community wiki: http://wiki.eprints.org/
- References:
- [EP-tech] Document field title/help-text using a phrase in workflow
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] Document field title/help-text using a phrase in workflow
- Prev by Date: [EP-tech] Document field title/help-text using a phrase in workflow
- Next by Date: Re: [EP-tech] Document field title/help-text using a phrase in workflow
- Previous by thread: [EP-tech] EPrints/CRIS
- Next by thread: [EP-tech] DOI handling in orcid_support_advance
- Index(es):