I keep getting an error "Feed list could not be imported. Please check that this is a valid OPML file.". Perhaps my OPML is incorrect?? Is there some way to configure this with only the URL so that the title is picked up from the feed?

<?xml version="1.0" encoding="utf-8"?>
<opml version="1.1">
<head>
<title>Mysite</title>
<dateModified>Tue, 23 Apr 2008 18:50:39 +0000</dateModified>
</head>
<body>
<outline text="Title" xmlUrl="URL" />
<outline text="Title" xmlUrl="URL" />
. . . etc
</body>
</opml>

. . . .

CommentFileSizeAuthor
#7 opml_meaningful_msg.patch2.1 KBaron novak

Comments

eyecon-1’s picture

Version: 6.x-1.2-beta2 » 6.x-1.x-dev
Component: User interface » Code
Category: support » bug

I am changing this to a bug. I have reviewed the OPML spec and removed title from the HEAD. The results are exactly the same. Moreover, the OUTLINE format conforms to the manner in which FeedAPI exports OPML.

eyecon-1’s picture

Title: OPML Import Problems » OPML Import - SOLVED partially

Removed <?xml version="1.0" encoding="utf-8"?>
Removed tags between <head> and </head>
Outline tags limited to xmlURL. In other words, no title or text tags. With these tags, whether checked or unchecked the respective fields on the import OPML form break the process.

A few of the feeds were not added. Should these failures be logged (they are not)? With a bunch of feeds, it becomes problematic to identify those that were not added.

aron novak’s picture

Title: OPML Import - SOLVED partially » Also OPML import should use SimpleXML
Assigned: Unassigned » aron novak
Category: bug » task
Priority: Normal » Critical

Yes. Sorry. The OPML parsing in FeedAPI is really useless. It expects exactly this string: "<?xml version="1.0"?>" .
Because Drupal 6 is php5 only, OPML import has to use SimpleXML also.
Sorry, i do not have time now to fix an inherently not good solution. I can promise you a whole new OPML processing code soon.
I'll add the weakness of the OPML import to the release notes.

Robin Millette’s picture

Do you mean FeedAPI for Drupal 6 is PHP 5 only? Because otherwise, Drupal 6 runs PHP 4 and 5. Drupal 7 will be PHP 5 only though.

aron novak’s picture

Component: Code » Code feedapi (core module)
Status: Active » Postponed

Right, can't be done because of php compatibility level of drupal

aron novak’s picture

Title: Also OPML import should use SimpleXML » Make OPML import more adaptable
Status: Postponed » Active
xml_parse_into_struct($parser, '<?xml version="1.0"?>'. $opml

These are should be avoided for example.

aron novak’s picture

Title: Make OPML import more adaptable » Make OPML import messages meaningful
Status: Active » Needs review
StatusFileSize
new2.1 KB

eyecon: i just used your example opml file in the initial post and filled with an example URL and it just worked.
However i found out that the OPML return messages are really awkward sometimes.
If the all of the feeds in the opml files are exist, the error msg about the valid feed appeared. Here is a patch to fix this.
Can you attach a whole opml file that you can't import? And where the feeds are not in the feedapi table. In that way, i would be able to debug deeper.

alex_b’s picture

Status: Needs review » Reviewed & tested by the community

"All of the feed URLs are already exist in the FeedAPI table."

"All of the feed URLs already exist in the FeedAPI table."

-> otherwise good to go.

aron novak’s picture

Status: Reviewed & tested by the community » Fixed

committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.