In this case I have a CSV file without a header line that I'd like to parse. It would be nice if I could override just the header functionality while still not having to maintain a complete fork of the CSV parser.

Attached is a patch that breaks out FeedsCSVParser::parse into parseHeader and parseItems which are independently overridable.

I'm very interested in what your thoughts are on doing this on plugins in general. I've run into this "overriding as complete forking" problem a couple times and think it would be great if we could logically break submethods out, even if it is a little more verbose than we would write if we didn't want plugins to be overridable.

I think the processors could especially benefit from this.

Files: 
CommentFileSizeAuthor
csvparser_submethodize.patch2.2 KBandrewlevine

Comments

alex_b’s picture

Status:Needs review» Fixed

I've run into this "overriding as complete forking" problem a couple times and think it would be great if we could logically break submethods out, even if it is a little more verbose than we would write if we didn't want plugins to be overridable.

I think this is generally a very good idea.

This is committed now, thank you.

http://drupal.org/cvs?commit=423240

Status:Fixed» Closed (fixed)

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