Skip to:
Content
Pages
Categories
Search
Top
Bottom

RSS activity feed is blank (solved)


  • danbpfr
    Participant

    @chouf1

    Hi all,

    i have a serious problem with the RSS feed for the site wide activity.
    The site (bp-fr.net) is in french, so it uses accent with UTF-8.
    I opened a ticket about this here: http://trac.buddypress.org/ticket/2680

    But if somebody using accented languages as german, french or swedish i.e. would have a solution right now, let know here.

    Thank you !

    wp 3.0.1
    bp 1.2.6

Viewing 12 replies - 1 through 12 (of 12 total)

  • danbpfr
    Participant

    @chouf1

    up!

    If you are referring to bp-fr, if you load the RSS in Firefox, it dies when it finds an uppercase “E” with an accent on in the parameter.</p> <p>Currently title is generated like: <code>html_entity_decode( utf8_encode( $text ) )</code>.<br /> Description is generated like: <code>html_entity_decode( str_replace( '%s', '', $text )</code></p> <p>Besides being inconsistent, as all the content is within CDATA tags, I am wondering if we should be running the text through the htmlspecialchars() code to generate the HTML character codes for these special characters? Something like: <code>htmlspecialchars(utf8_encode($string), ENT_QUOTES)</code></p> <p>Anyone out there who can help me learn this stuff? I’ve not really looked into the RSS spec, etc, before.

    Another cheeky bump chouf1 ;)

    Apropos the problem I had someone report to me earlier that they got a blank page when clicking the activity feed, I couldn’t replicate and dismissed them especially as the feed worked when parsed into another site, they were working on a Mac.

    Content in cdata tags? is that correct?

    Hmm just checked the feed and it’s gone all haywire the rss link isn’t working and wont take me to /activity/feeds/ just adds display none to div.activity, really hope this is not an issue but it’s too late to look into it but there goes my day tomorrow down the pan ;)

    Ok quick test the rss feed link on my activity page 1.2.5.2 / 1.2.6 is being messed around with by JS as long as I disable JS in browser the link directs correctly, but not going to look into why at this hour


    danbpfr
    Participant

    @chouf1

    @hnla CDATA, yes you’re correct.

    I opened a few tickets in the past mentionning this same problem with previous version.
    We have also a long tread on the bp-fr.net forum here (opened 6 mouth ago), with mac and pc output difference. But finally i bring it to work under bp 1.2.3 – anf FF 3.6
    IE says code error due to CDATA


    danbpfr
    Participant

    @chouf1

    This morning i changed somme phrase in the translation and i can see this in the activity RSS feed:
    <![CDATA[stephane a r?pondu au sujet Activités du membre

    a r?pondu au sujet : is the translated expression with a normal accented e (here i do not use & eacute )
    Activités du membre : is the post title, as he is transmitted by WP to the DB and extracted by WP to the feed

    infortunatelyy i get the same result by using accented e wit & eacute…


    danbpfr
    Participant

    @chouf1

    CDATA means caracter datas and doesn’t need to be passed encoded. So my conclusion is that there is somewhere a double encoding or something like this. Anyway.

    I changed the code in bp-activity-template-tags.ph:1031
    From
    `//$title = trim( strip_tags( html_entity_decode( utf8_encode( $content[0] ) ) ) );
    To
    $title = strip_tags(html_entity_decode( html_entity_decode( $content[0] ) )) ;`

    and retrieved the accent in the translation. Now i have the title in the feed with a correct output on the title given by the user
    When the accent is passed trought the translation ( i tried a normal, accent, & eacute and # &233 ) the feed fails.

    view here:
    http://bp-fr.net/activity/feed/


    danbpfr
    Participant

    @chouf1

    i’m actually working on this problem…


    danbpfr
    Participant

    @chouf1

    …and solved it ! Tadaaaaaaaaaaa…. (with some tech helps)

    Dixit php manual: Unrecognized character-sets will be ignored and replaced by ISO-8859-1. Because the default character of php is ISO-8859-1

    So, in activity-templatetags.ph: 1031
    replace
    `//$title = trim( strip_tags( html_entity_decode( utf8_encode( $content[0] ) ) ) );
    byy
    $title = strip_tags(html_entity_decode( $content[0],ENT_COMPAT,”UTF-8″ )) ;`

    and do the same for the description line 1071
    `return apply_filters( ‘bp_get_activity_feed_item_description’, html_entity_decode( str_replace( ‘%s’, ‘ ‘, $content ), ENT_COMPAT, ‘UTF-8’ ) );`

    With this my acitivity RSS feed is now in french with accentuated characters !

    Have to do the same with the other feeds file and control the whole WP code containing entities_decode WICH MUST ending with UTF-8 to pass correctly….

    I put the patchs on the trac immediatly


    Roger Coathup
    Participant

    @rogercoathup

    hats off to @Chouf1 – a. for solving it, and b. for ‘tagging’ the thread as solved – we should all get into that discipline (although a button to do it automatically would be nicer)


    danbpfr
    Participant

    @chouf1

    this button was existing in the early buddypress.org versions (before bbpress inclusion)
    can you test these changes on a english install

    Fixed ticket is here: https://trac.buddypress.org/ticket/2680#comment:1


    Hollosch
    Participant

    @hollosch

    Works perfect ! THX

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘RSS activity feed is blank (solved)’ is closed to new replies.
Skip to toolbar