CFFEED: String index out of range: -1

Today I decided it would be cool to give cffeed a try.

I read over the documentation and created a script to pull a few different feeds based on a database table of feeds.

My first two rss feeds ran without any problem.

The last two feeds threw an error.

Here is the error I am receiving:

String index out of range: -1

Here is the code:

<cftry>
<cffeed
source = "http://feeds.sphinn.com/sphinn" query = "theFeed"
>

<cfcatch>
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>

I updated my CF 8 installation to 8.01 because I thought maybe it was a bug but that didn't seem to help.

Any ideas what could be causing this error?

TrackBacks
There are no trackbacks for this entry.

Trackback URL for this entry:
http://www.cfedge.com/trackback.cfm?D4F29DBD-E02E-757E-0422590CD778D9B2

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Ben Nadel's Gravatar Try getting the value via CFHttp first and the use XmlParse(). That way, we can figure out where the problem exists (the getting or the parseing).

<cfhttp url="http://feeds.sphinn.com/sphinn"; action="get" result="objGet" />

<cfdump var="#objGet#" />

<cfset xmlData = XmlParse( Trim( objGet.FileContent ) ) />

<cfdump var="#xmlData#" />

Try that and see iwhere the error happens. Might help.
# Posted By Ben Nadel | 5/7/08 11:00 AM
Randy Johnson's Gravatar I set that up and ran the page. It ran without any problems. No errors on the get or the parse. I am baffled by it, the only thing that is remotely kind of weird is the ~ in the urls, but that's proper url syntax and the XMLParse works just fine.
# Posted By Randy Johnson | 5/7/08 11:27 AM
Raymond Camden's Gravatar I ran Ben's code on a 801 server (after fixing his typos, dude, do you even KNOW CF?!!?!!!? (kidding ;)), and it worked fine for me. Randy - are you sure your update to 801 was complete?
# Posted By Raymond Camden | 5/7/08 11:31 AM
Raymond Camden's Gravatar Woah! I stand corrected. In my quick test I used name= for cffeed, which gives you a struct. It worked. I tried query and it gave the error you described. So this is definitely a bug. Be sure to report it.

http://www.adobe.com/go/wish
# Posted By Raymond Camden | 5/7/08 11:32 AM
Ben Nadel's Gravatar I think the typos keep you on your toes :)
# Posted By Ben Nadel | 5/7/08 11:33 AM
Raymond Camden's Gravatar So just so it's clear, you can use the struct version for now in case this is a pressing business need for ya.

CFFEED... I'm happy Adobe added it, but boy has it been flakey.
# Posted By Raymond Camden | 5/7/08 11:36 AM
Randy Johnson's Gravatar Ben & Ray,

Thanks for your help. I will be sure to report the bug and use a struct for now.
# Posted By Randy Johnson | 5/7/08 11:37 AM
Randy Johnson's Gravatar I have reported this bug to Adobe.
# Posted By Randy Johnson | 5/7/08 11:42 AM
Theo Rushin Jr's Gravatar There is nothing wrong with your code. Through a process of trial and error I found that it is a bug in CF8. The CFFEED tage chokes on the <dc:creator /> tag.
If you balance the tag (I know you cant because it's not your feed) like so; <dc:creator>Test</dc:creator> or remove it then it works properly. I don't know if that's the only tag it chokes on or not.

Solution? Use the name Attribute and then create your Query from the resulting structure.
# Posted By Theo Rushin Jr | 5/7/08 12:08 PM
Hemant's Gravatar We will look into this issue.

Thanks,
Hemant
Adobe ColdFusion Team
# Posted By Hemant | 5/8/08 6:02 AM
Jayesh<BR>Adobe CF Team's Gravatar Confirming this problem. Have logged a bug for this. As somebody already suggested here Null values for the <dc:creator/> tag is the culprit. It's also same for other DC tags.
# Posted By Jayesh<BR>Adobe CF Team | 5/12/08 3:05 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.7.