EPrints Technical Mailing List Archive

Message: #04155


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: (no subject)


Hi Mike,

I think this is the most recent incantation of that issue:

http://www.eprints.org/tech.php/18737.html

 

NB The mailing list breaks perl code (e.g. changing ‘@_’ to ‘AT _’) – although I’m sure you’ll be able to make sense of it!

 

Does that thread help?

 

Cheers,

John

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Michael Street
Sent: 22 April 2015 16:09
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] (no subject)

 

Hi,

 

I recently migrated from v2 to v3 and am strangely enough, having the exact same issue I did 10 years ago, the last time I upgraded.  I managed to dig up an old thread I had posted in 2005 with the same situation.  Essentially it's that all the abstracts seem to no longer be displayed with their line breaks/paragraphs.  When editing the field, the paragraphs are there but they are not displayed on the summary page.

 

I've tried the fix from 10 years ago but as you might expect, that did not work.  I tried sticking the code snippet into eprint_field.pl.

 

Any help would be greatly appreciated thanks.

 

--Mike

 

Thread from 10 years ago:

------

 

Fra:  owner-eprints-tech@xxxxxxxxxxxxxxx [mailto:owner-eprints-tech@xxxxxxxxxxxxxxx] På vegne af  Christopher Gutteridge
Sendt:  12. maj 2005 15:09
Til:
 EPrints.org Technical List
Emne:  Re: [EP-tech] Linefeeds in Abstract field

Hmm. I'm not sure why that changed. The default rendering for fields of type "longtext" appears to just turn them into a single block of text now.


It's easily worked around however by adding the a rendering parameter to the "abstract" field config in ArchiveMetadataFieldsConfig.pm:

----------------------
{ name => "abstract", input_rows => 10, type => "longtext", render_single_value=>sub {

    my( $session, $field, $value ) = @_;

   my @paras = split( /\r\n\r\n|\r\r|\n\n/ , $value );


   my $frag = $session->make_doc_fragment();

   foreach( @paras )
   {

       my $p = $session->make_element( 

           "p", 

           class=>$self->{name}."_paragraph" );

       $p->appendChild( $session->make_text( $_ ) );

       $frag->appendChild( $p );

   }
   return $frag;


},

------------------
and restart apache and MAKE SURE IT WORKS,as i've just cut and pasted the code

then run generate_abstracts to fix the ones which are wrong.

The "render" paramters only effect how a value is converted to XHTML, so they can

safely be played with without effecting the underlying data.


Michael Street wrote: 

Hi Folks, 

I migrated an EPrints archive from v2 to v2.3.7 on a new server.  Everything seems in order except for the linefeeds and paragraphs in the Abstract field.  In the old version they show up fine, but in the new version it is all one paragraph. 


Anyone know how I might be able to fix this?   


I should mention that when I edit the eprint, the paragraphs are there, they just don't show up when you view it. 


Thanks in advance, 

Mike. 


 
-- Christopher Gutteridge -- 
cjg@xxxxxxxxxxxxxxx -- +44 (0)23 8059 4833 
University of Southampton, School of Electronics and Computer ScienceChris is currently listening to: . Obligatory Random Quote: Shout     
Britain, raise a joyful shout, The Tyrant Tories all are out --       Deluded Britains -- cease your din -- For lo -- the scoundrel Whigs   
are in. -- Hartley Coleridge (1796-1849)