EPrints Technical Mailing List Archive

Message: #09087


< 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


CAUTION: This e-mail originated outside the University of Southampton.

Hi David,
Thanks for the quick response.

I think the solution is sensible - and would not impact performance too much in the rare cases it is used.

 

It works in 3.3.

 

Cheers,

John

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of David R Newman via Eprints-tech
Sent: 05 October 2022 09:33
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

 

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

 

On 04/10/2022 10:43 am, John Salter via Eprints-tech wrote:

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: 

  1. upload two documents to an eprint.
  2. In the workflow, change the default field spec:
    1. <field ref="license"/>
  1. to use a phrase for the help-text: 
    1. <field ref="license">
    2.   <help><epc:phrase ref="archive_name"/></help>
    3. </field>
  1. 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.

 

and I suspect the issue may lie with this 'clone':

 

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/