Developer
Supported
Rest
Back to this add-on's main page
View Other Add-ons From Phil Sturgeon
CDATA Issue, emtpy array
Bug Report
|
mz91184
|
| Posted: 08 March 2011 05:45 PM |
|
|
|
|
I posted a request for help with the WeatherBug API earlier. After more investigation, I think it is a bug.
WeatherBug API RSS Request File - http://cl.ly/1m003u471y0d1g311E2d
Screenshot of RSS Request - http://cl.ly/3E100i3e3L0L382C3O0c
Screenshot of print_r($response) at line 84 on pi.rest.php http://cl.ly/2G2s443G472Q0F3N172N
Screenshot of template code - http://cl.ly/1B0B1J2i3M2W2x1k2i2m
The issue I am having is the item - description array appears to be empty. If you look at the RSS Request you can see it has item - description contains a <![CDATA[ ]]> with all the attributes I need inside it. I can’t access these attributes because the array is empty.
I need help resolving this bug.
|
|
|
|
|
philsturgeon
|
| Posted: 08 March 2011 06:22 PM |
# 1
|
|
|
Developer
|
Hi mz91184, I will try to take a look into this one as soon as I can. Things are a bit mental over here, but hopefully I can get back to you with a solution tomorrow or Thursday. Hopefully that is not too long.
|
|
|
|
|
mz91184
|
| Posted: 08 March 2011 06:26 PM |
# 2
|
|
|
|
philsturgeon,
Thanks for the fast reply. Thursday works fine.
I am currently scheduled to show the client the first version of the site next week Friday.
|
|
|
|
|
mz91184
|
| Posted: 11 March 2011 08:20 PM |
# 3
|
|
|
|
philsturgeon,
Has there been any progress resolving this bug?
|
|
|
|
|
philsturgeon
|
| Posted: 12 March 2011 04:01 PM |
# 4
|
|
|
Developer
|
Got it! simplexml_load_string() actually actively destroys CDATA unless you specifically tell it not to with an obscure flag. Well I never! :)
http://d.pr/SuZD
Posted an updated 1.5.2 so please download this again.
Also, with RSS you dont need to mention channel or item, those tags are assumed as base. Otherwise you can just use XML as the type to parse the document with nothing assumed.
|
|
|
|
|
mz91184
|
| Posted: 12 March 2011 06:14 PM |
# 5
|
|
|
|
philsturgeon,
Thanks for the quick fix; I really appreciate it. Sounds like it was an odd error.
I will download it again and give it a try later today.
Thanks for the tip on the channel and item tags. I was trying a bunch of odd tags to get it work before I looked into the backend and found issue.
Edit: I forgot to say, I love this add-on. Great work.
|
|
|
|
|
mz91184
|
| Posted: 12 March 2011 10:16 PM |
# 6
|
|
|
|
Would you mind posting a screen shot of the template code? I am trying to get the description tag (with the weather results) like you did but can only get the parent description tag “Weatherbug, the owner of the world’s largest…..”.
I can see the code working correctly, I am sure I am just stuck on how to use it in the template.
|
|
|
|
|
philsturgeon
|
| Posted: 24 March 2011 11:05 AM |
# 7
|
|
|
Developer
|
Sorry I missed this reply. EE Forum module only notifices my of the newest reply since I read the thread, and after your last post I didn’t feel the need to come back to thirs thread as things looked done. I randomly ended up here today and saw this.
So:
<ul> {exp:rest name="weatherbug"}
<li>{title}<br/>{description}</li>
{/exp:rest} </ul>
|
|
|
|
|
mz91184
|
| Posted: 24 March 2011 02:43 PM |
# 8
|
|
|
|
no worries, thanks for all the help.
|
|
|
|