CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Broken feed using wordpress "&raquo" not being rendered?
Pages: [1]

Author Topic: Broken feed using wordpress "&raquo" not being rendered?  (Read 3152 times)

hamish_old

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.2.0
  • CMS version: Wordpress
  • MySQL version: 5.3
  • PHP version: 5.1.39
Broken feed using wordpress "&raquo" not being rendered?
September 02, 2012, 11:35:45 pm
Hi guys,
I'm trying to send an event feed to simplepie to list in a widget.
Using Wordpress and Civicrm 4.2.0

It's not showing up.  Trying to render the RSS in Firefox gives this error:

NOTE: I had to put in some asterisks to let me post a link.

XML Parsing Error: undefined entity
Location: http*://stjames.prophetech.net/?page=CiviCRM&q=civicrm/event/ical&reset=1&list=1&rss=1
Line Number 27, Column 1:<link rel="alternate" type="application/rss+xml" title="St James Church &raquo; Feed" href="http*://stjames.prophetech.net/feed/" />

and in Chrome:
This page contains the following errors:
error on line 27 at column 89: Entity 'raquo' not defined

I'm no coder - but it looks to me as if the second quote isn't being rendered in the output?

Cheers,
Hamish

hamish_old

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.2.0
  • CMS version: Wordpress
  • MySQL version: 5.3
  • PHP version: 5.1.39
Re: Broken feed using wordpress "&raquo" not being rendered?
September 03, 2012, 11:13:47 pm
Confirmed on civicrm testsite:
Again - Asterisks inserted into links

Message from firefox:
XML Parsing Error: undefined entity
Location: http*://wordpress.demo.civicrm.org/?page=CiviCRM&q=civicrm/event/ical&reset=1&list=1&rss=1
Line Number 24, Column 1:<link rel="alternate" type="application/rss+xml" title="CiviCRM 4.2 Demo Site &raquo; Feed" href="http*://wordpress.demo.civicrm.org/?feed=rss2" />
^

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Broken feed using wordpress "&raquo" not being rendered?
September 04, 2012, 11:22:05 am

this problem is a bug with the Civi + WP integration and affects a few urls.

There are a few cases where Civi needs to send a complete document and ignore any theme/template from WP.

We dont have a solution for this as yet, so if you can help debug and figure out how other WP extensions handle this that would be great.

in the below case specifically, civi sends the entire iCal document. the WP html should be suppressed

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

johndieter

  • I’m new here
  • *
  • Posts: 25
  • Karma: 0
  • CiviCRM version: 4.1 beta 2
  • CMS version: drupal 7.10
  • MySQL version: 5
  • PHP version: 5
Re: Broken feed using wordpress "&raquo" not being rendered?
September 18, 2012, 08:53:37 am
Also get these errors with drupal 7x - pointing at the &acirc:
XML Parsing Error: undefined entity
Location: https://www.hgs.org/civicrm/event/ical?reset=1&list=1&rss=1
Line Number 15, Column 143:
...Exhibition &acirc;

johndieter

  • I’m new here
  • *
  • Posts: 25
  • Karma: 0
  • CiviCRM version: 4.1 beta 2
  • CMS version: drupal 7.10
  • MySQL version: 5
  • PHP version: 5
Re: Broken feed using wordpress "&raquo" not being rendered?
September 18, 2012, 03:01:35 pm
NOTE: &acirc is some kind of encoding problem. civi is UTF-8 hard coded all over the place and some other encoding is producing the &acirc
The &acirc in the event description breaks the feed.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Broken feed using wordpress "&raquo" not being rendered?
September 18, 2012, 10:47:36 pm

the feed is broken due to the html stuff in the feed. Pretty sure this is not an encoding issue only

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

hamish_old

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.2.0
  • CMS version: Wordpress
  • MySQL version: 5.3
  • PHP version: 5.1.39
Re: Broken feed using wordpress "&raquo" not being rendered?
September 26, 2012, 04:53:17 pm
So is the above case where it should return an rss feed, is the problem:
a) civicrm isn't returning a valid RSS file (html error). 
or
b) civicrm is providing a proper RSS file, but it is being intercepted by WP that's where the error occurs.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Broken feed using wordpress "&raquo" not being rendered?
September 27, 2012, 12:14:45 am

IMO, b is definitely the main problem

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

dreadedhamish

  • I’m new here
  • *
  • Posts: 15
  • Karma: 1
  • CMS version: Drupal 7, Wordpress
Re: Broken feed using wordpress "&raquo" not being rendered?
January 31, 2013, 01:23:48 am
So every now and then I have a poke around to see if I can get a clue as to what is causing this error.  I'm out of my depth!

But... The undefined entity error for xml is caused by using characters not allowed in xml.

& is one of those illegal characters, while (&amp;) and {&#38;) are allowed.

The link being passed looks like this:
wordpress.demo.civicrm.org/?page=CiviCRM&q=civicrm/event/ical&p=11&reset=1&id=1

But is actually this:
http://stjames.prophetech.net/?page=CiviCRM&q=civicrm/event/ical&amp;reset=1&amp;list=1&amp;rss=1

See the one "&" in CiviCRM&q=civicrm?

Could this be the issue?

Looking in util/iCalendar.php there is a function to replace unsafe strings like this:
$text = str_replace(";", "\;", $text);

If this is the problem, would I write a rule like this:
$text = str_replace("&","&amp", $text); or would that strip lots of "&"'s?

If I'm way off let me know...  like I said I have no idea what I'm doing...

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Broken feed using wordpress "&raquo" not being rendered?
February 11, 2013, 07:05:54 am

The url is a minor part of the issue. We need to basically short circuit WP in this case and not enclose it within html also which is the main issue

someone familiar with php and wp will need to help debug and provide a fix

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

gsibert

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.2.7
  • CMS version: WordPress 3.5.1
  • MySQL version: 5.5
  • PHP version: 5.4
Re: Broken feed using wordpress "&raquo" not being rendered?
February 15, 2013, 04:08:21 pm
Not sure if I went about this the right way but I got things working for my needs related to this issue. I wrote down what I did to strip the html code and get rid of the XML parse error (a bandaid as I didn't want to hunt down the source of the XML). Hmm, asterisks to allow link

*http://tummel.me/broken-feeds-civicrm-and-wordpress/*

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Broken feed using wordpress "&raquo" not being rendered?

This forum was archived on 2017-11-26.