[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[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 at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of David R Newman via Eprints-tech
Sent: 05 October 2022 09:33
To: eprints-tech at ecs.soton.ac.uk; John Salter <J.Salter at 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://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fissues%2F109&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098693299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1gFXprZON95U80CH7V2WDbmE2ZsoybOXkQhZ0ov21NY%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fissues%2F109&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098693299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1gFXprZON95U80CH7V2WDbmE2ZsoybOXkQhZ0ov21NY%3D&reserved=0>
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://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fblob%2Fmaster%2Fperl_lib%2FEPrints%2FMetaField.pm%23L423&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098693299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=81q8MRmhDoosYiFMnxUA%2FW8wQY6wZdgTaH%2Bj%2B%2BK5zfg%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fblob%2Fmaster%2Fperl_lib%2FEPrints%2FMetaField.pm%23L423&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098693299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=81q8MRmhDoosYiFMnxUA%2FW8wQY6wZdgTaH%2Bj%2B%2BK5zfg%3D&reserved=0>
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fblob%2Fmaster%2Fperl_lib%2FEPrints%2FMetaField.pm%23L477&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098693299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=O7ZtTWAhdxbdC8opQzqCyaKuzialRIiVayQf%2FwLY9fs%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fblob%2Fmaster%2Fperl_lib%2FEPrints%2FMetaField.pm%23L477&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098693299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=O7ZtTWAhdxbdC8opQzqCyaKuzialRIiVayQf%2FwLY9fs%3D&reserved=0>
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:
* <field ref="license"/>
1. to use a phrase for the help-text:
* <field ref="license">
* <help><epc:phrase ref="archive_name"/></help>
* </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.
I've traced the help-text back to:
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2Fmaster%2Fperl_lib%2FEPrints%2FPlugin%2FInputForm%2FComponent.pm%23L496-L503&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098693299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=yqSIoglZWutf%2FcGgoCGu8PdH5cjRzCVRBopdZF4wnGE%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2Fmaster%2Fperl_lib%2FEPrints%2FPlugin%2FInputForm%2FComponent.pm%23L496-L503&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098693299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=yqSIoglZWutf%2FcGgoCGu8PdH5cjRzCVRBopdZF4wnGE%3D&reserved=0>
(v3.4 equivalent: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fblob%2Fmaster%2Fperl_lib%2FEPrints%2FPlugin%2FInputForm%2FComponent.pm%23L450-L457&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098693299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JKmbP2nSb%2Fsa9IllJLrZ3ft0Lx3rcmL6mQj2iWnZEsI%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fblob%2Fmaster%2Fperl_lib%2FEPrints%2FPlugin%2FInputForm%2FComponent.pm%23L450-L457&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098693299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JKmbP2nSb%2Fsa9IllJLrZ3ft0Lx3rcmL6mQj2iWnZEsI%3D&reserved=0> )
and I suspect the issue may lie with this 'clone':
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2Fmaster%2Fperl_lib%2FEPrints%2FPlugin%2FInputForm%2FComponent.pm%23L527&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098693299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=eW8gw%2Fz%2FzVl9IV1wyzzXiVS33AmaErljK4I6%2FOeJpcw%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2Fmaster%2Fperl_lib%2FEPrints%2FPlugin%2FInputForm%2FComponent.pm%23L527&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098693299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=eW8gw%2Fz%2FzVl9IV1wyzzXiVS33AmaErljK4I6%2FOeJpcw%3D&reserved=0>
(v3.4 equivalent: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fblob%2Fmaster%2Fperl_lib%2FEPrints%2FPlugin%2FInputForm%2FComponent.pm%23L481&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098849512%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jKKcuQW0%2FZFmRi8Q4LuBbwTiPzVBbv6ogvcjbK2gR1Y%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fblob%2Fmaster%2Fperl_lib%2FEPrints%2FPlugin%2FInputForm%2FComponent.pm%23L481&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098849512%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jKKcuQW0%2FZFmRi8Q4LuBbwTiPzVBbv6ogvcjbK2gR1Y%3D&reserved=0> )
Cheers,
John
[cid:image001.png at 01D8D8A0.66EE2640]
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.ecs.soton.ac.uk%2Fmailman%2Flistinfo%2Feprints-tech&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098849512%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=0RXCZPxGg3pq3IvB2%2B9Rhtvlm9cHD6mfWLtJiBLGPts%3D&reserved=0>
*** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098849512%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=OX4Q3N72o0XRHQh1YDB3r4CMhoQu3A8FqFR3avSrUso%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098849512%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=OX4Q3N72o0XRHQh1YDB3r4CMhoQu3A8FqFR3avSrUso%3D&reserved=0>
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098849512%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8NK8R6CoqOlRyRgJ7Gq02bNtw7uHlZI8tycL2DenGcg%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cebfb2503cc6143dd862108daa6afc4f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005571098849512%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8NK8R6CoqOlRyRgJ7Gq02bNtw7uHlZI8tycL2DenGcg%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20221005/ca16edda/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 78722 bytes
Desc: image001.png
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20221005/ca16edda/attachment-0001.png