Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Blog module and FirstParagraph - BUG?


Reply

4 Posts   1812 Views

Avatar
Aaron

12 June 2008 at 7:47pm Community Member, 63 Posts

Possible bug with the current nightly build and SS 2.2.2 fresh install.

This only applies when BlogEntry::allow_wysiwyg_editing(); is included in _config.php

Line 111 of BlogEntry.php - ParagraphSummary Method

function ParagraphSummary(){
      if(self::$allow_wysiwyg_editing) {
         return $this->obj('Content')->FirstParagraph('html');
      } else {
         $parser = new BBCodeParser($this->Content);
         $html = new HTMLText('Content');
         $html->setValue($parser->parse());
         return $html->FirstParagraph('html');
      }
   }

$this->obj('Content')->FirstParagraph('html') doesn't appear to return the first paragraph at all? Seems to work fine when wysiwyg is disabled.


Problem with the FirstParagraph method?

Avatar
Aaron

12 June 2008 at 7:51pm Community Member, 63 Posts

Ah, comment above FirstParagraph method in sapphire/core/models/fieldtypes/Text.php

/**
    * Caution: Not XML/HTML-safe - does not respect closing tags.
    */

Avatar
Sam

7 July 2008 at 11:45am Administrator, 685 Posts

This issue is being tracked here: http://open.silverstripe.com/ticket/2547

Avatar
Garrett

23 August 2008 at 4:23am Community Member, 245 Posts

Thank you VERY MUCH for this thread-- this was VERY helpful to me, as I had the same problem myself after enabling HTML in the Blog Entries.

//Garrett