Remember me? forgot password | register

SilverStripe Forum

3818 Posts in 841 Topics by 527 members

Jump to:

Extending and hacking

If this is your first visit, you will need to register before you can post. However, you can browse all messages below.

Community » SilverStripe Forum » Extending and hacking » Blog module and FirstParagraph - BUG?
Page: 1 go to end Reply
Author Topic: Blog module and FirstParagraph - BUG? 319 views
  • Aaron
    Aaron's avatar
    Community Member
    63 posts

    Blog module and FirstParagraph - BUG? Link to this post

    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?

  • Aaron
    Aaron's avatar
    Community Member
    63 posts

    Re: Blog module and FirstParagraph - BUG? Link to this post

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


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

  • Sam
    avatar
    Core Development Team
    477 posts

    Re: Blog module and FirstParagraph - BUG? Link to this post

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

  • Garrett
    Garrett's avatar
    Community Member
    45 posts

    Re: Blog module and FirstParagraph - BUG? Link to this post

    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

    319 views
go to top Reply

Currently Online:

SmartPlugs Design, Sigurd, kickme

Welcome to our latest member: Anonymous user