[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DgLYSzNw5kRhhU5rgQYQOgKygxYibd11FikU3txlmA4%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%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FksgxkJJYZXF171nN9arOlrmV50hr7bh6lw0cOZeUco%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%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8oKJh%2BmD4eoum2rjpp33uN6R%2BnY7Rb6uCtzwr3e8kqM%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:
>      1. <field ref="license"/>
>  3. to use a phrase for the help-text:
>      1. <field ref="license">
>      2. <help><epc:phrase ref="archive_name"/></help>
>      3. </field>
>
>  3. 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&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=eMlL0TeSckR1Aw0a5i4WhlYltnLeOVhuuXZJnVmVhMI%3D&amp;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&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=eMlL0TeSckR1Aw0a5i4WhlYltnLeOVhuuXZJnVmVhMI%3D&amp;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&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=fiybEEhZxFazQBmWnMBcUmDNb9qOwKmjlk8zruOA8Ow%3D&amp;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&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=fiybEEhZxFazQBmWnMBcUmDNb9qOwKmjlk8zruOA8Ow%3D&amp;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&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=wJBJbg5ycpyeXH%2FzkFDAljykFQkociO7OZou3XvxhVQ%3D&amp;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&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=wJBJbg5ycpyeXH%2FzkFDAljykFQkociO7OZou3XvxhVQ%3D&amp;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&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=gIRBK1BIrO9lFo7ILyCIm07yhrjuxxjgRPAXILvxR4Q%3D&amp;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&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=gIRBK1BIrO9lFo7ILyCIm07yhrjuxxjgRPAXILvxR4Q%3D&amp;reserved=0>?)
>
> Cheers,
> John
>
>
>
>
>
> *** Options:http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=8hiY4GemuV4XPY5ZEZtLO80JKqZGble1x1sflOLm3b0%3D&amp;reserved=0
> *** EPrints community wiki:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Ce7993b1acd73477c106d08daa6ac467a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638005556083456445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=VJt1zyP%2FGZ3hlS9DaSkSPkz122v%2FJJ0hJjdFZakC%2F9U%3D&amp;reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20221005/20e8cdc8/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 78722 bytes
Desc: not available
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20221005/20e8cdc8/attachment-0001.png