FeedsSyndicationParser offers a mapping source author_name but actually does not populate this slot.

CommentFileSizeAuthor
#7 feeds.patch2.82 KBbigkevmcd

Comments

michelle’s picture

I've been trying to track this down. I haven't figured out the problem, yet, but will record what I have so far.

  • The source of the sample feeds I'm using doesn't contain "author" but rather <dc:creator>NAME</dc:creator>
  • function _parser_common_syndication_RSS20_parse($feed_XML) is only looking for author
  • Adding code to use dc:creator does not work because that field is excluded from $feed_XML

I need to get to bed but I'll try to trace it back further tomorrow since this is a really key item for me to give proper credit.

Michelle

michelle’s picture

One more step then I must sleep.

In common_syndication_parser_parse, $string contains the dc:creator but then it's passed into simplexml_load_string() and the resulting $xml does not have the dc:creator. I can't find simplexml_load_string() anywhere, though, so I'm stuck for the moment.

Michelle

michelle’s picture

After talking to RobLoach on IRC, it turns out that simplexml_load_string() is a PHP function. Since it's that function that's not recognizing "creator", I don't know where to go from here. I could really use some input from the maintainer(s).

Thanks,

Michelle

michelle’s picture

alex_b’s picture

Michelle - OTOH - you must register the namespace of tags that you would like to parse. SimpleXML will ignore tags of namespaces it doesn't know anything about.

michelle’s picture

How do I do that? And why doesn't it know it already? From what I can tell, "dc:creator" is a standard and common tag in RSS feeds. It's not something custom I'm doing. It seems like Feeds should be able to handle it by default. I'm willing to help make that happen but I'm brand new to RSS outside of the Opera feed reader so I'm fumbling in the dark here quite a bit.

Michelle

bigkevmcd’s picture

StatusFileSize
new2.82 KB

I'm attaching a patch which fixes two issues:

1) the RSS parser was using "author" as the author key, but the mapper expects "author_name", there are no tests for the behaviour of "author_name" in the current code base...

2) We attempt to parse the dc:Creator if there's no author element.

Currently a lot of tests are failing without this patch on HEAD, if this can be resolved, I'll happily add some tests for both these fixes.

michelle’s picture

Status: Active » Reviewed & tested by the community

I've been speaking to bigkevmcd on IRC and can confirm this patch fixes the issue for me. I'd like to see this committed since I hate running patched modules if I can avoid it. :)

Michelle

alex_b’s picture

Priority: Normal » Critical

Should go into next release. Bumping to critical.

michelle’s picture

Awesome, thanks!

Michelle

alex_b’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thank you. bigkevmcd: if you're still up for tests, I'd be happy to receive patches.

Status: Fixed » Closed (fixed)

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