<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-IE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have noticed that the issue of trailing spaces and spaces in between the words in several fields happens during the process of db upgrade as well. In our upgrade to 3.3.12 from 3.0.5 this happened in the department field which causes views to these departments listed more than once ( which in the older version would have been listed only once). I ran update stmts in db to fix it but may be if the patch is in the code permanently that might not happen!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Ranju Upadhyay<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>National University of Ireland Maynooth.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] <b>On Behalf Of </b>Sebastien Francois<br><b>Sent:</b> 17 October 2013 12:53<br><b>To:</b> eprints-tech@ecs.soton.ac.uk<br><b>Subject:</b> [EP-tech] Re: Patch suggestion: Form value of MetaField::Name fields having surrounding spaces stripped off<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi Florian,<br><br>See <a href="https://github.com/eprints/eprints/issues/11">https://github.com/eprints/eprints/issues/11</a> and its fix perhaps?<br><br>Could you also raise a ticket in github for your issue (if not fixed by the above patch) please?<br><br>Thanks!<br>Seb.<br><br>On 17/10/13 12:46, Florian Heß wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>Hi E-Prints developers,<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>if the user happens to leave trailing spaces in the name field, the <o:p></o:p></pre><pre>browse view would display the name once more and ignore that the name <o:p></o:p></pre><pre>already exists without trailing space. That's why the creator's browse <o:p></o:p></pre><pre>view accumulates doubles and maybe triples of names over time. So how <o:p></o:p></pre><pre>about stripping off accidentally input spaces so the repos browse views <o:p></o:p></pre><pre>- those generated of fields with freely entered values - are kept clean?<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Please tell me if the patch will be applied officially in the next <o:p></o:p></pre><pre>version of EPrints, or if I am rather to use the fromform()-callback. In <o:p></o:p></pre><pre>my opinion, this issue isn't specific to our repository, hence ...<o:p></o:p></pre><pre><o:p> </o:p></pre><pre># in package MetaField::Name ...<o:p></o:p></pre><pre># inspired from sub &MetaField::Multipart::form_value_basic<o:p></o:p></pre><pre>sub form_value_basic<o:p></o:p></pre><pre>{<o:p></o:p></pre><pre> my( $self, $session, $basename ) = @_;<o:p></o:p></pre><pre><o:p> </o:p></pre><pre> my $value = <o:p></o:p></pre><pre>$self->EPrints::MetaField::Compound::form_value_basic( $session, <o:p></o:p></pre><pre>$basename );<o:p></o:p></pre><pre><o:p> </o:p></pre><pre> s{^\s+}{}, s{\s+$}{} for values %$value;<o:p></o:p></pre><pre><o:p> </o:p></pre><pre> return $value;<o:p></o:p></pre><pre>}<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>The patch has been roughly tested.<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Kind regards,<o:p></o:p></pre><pre>Florian<o:p></o:p></pre><pre><o:p> </o:p></pre></blockquote><p class=MsoNormal><o:p> </o:p></p></div></body></html>