Fatal error: Call to a member function parse() on a non-object in /home/cyberfan/htdocs/modules/feedapi_eparser/feedapi_eparser.module on line 79

Thanks if you can help!

CommentFileSizeAuthor
#9 feedapi_eparser.patch1.06 KBb-prod
#7 feedapi_eparser.patch1.04 KBb-prod

Comments

eterps’s picture

Same here.

Fresh Install of Drupal 6.13
php 5.2.9

Extensible parser is the only parser enabled. Only a handful of Core modules enabled, along with CCK, views, administration menu, ImageCache, Panels, Pathauto, Token.

Processor: FeedAPI Node

Example feeds:
http://feeds.gawker.com/lifehacker/full
http://news.google.com/news/section?pz=1&topic=t&ict=ln

neclimdul’s picture

Status: Active » Postponed (maintainer needs more info)

This means that ctools wasn't able to find your parsing plugin. What version of ctools are you using and what options have you setup in the EParse tab?

eterps’s picture

I'm using CTools 1.0 released on Aug 19.

Eparse settings:
Download Type: Drupal HTTP Request
Feed Type: RSS 2.0

stian’s picture

Version: 6.x-1.x-dev » 6.x-1.0

I get the same problem.
I did some further digging though.

It seems like the ctools settings form doesn't proceed to the next form when you press next, resulting in no settings get stored to the database.
Then in feedapi_eparser_load_type_plugin() when you try to load settings, there is no such thing as $efeed->eparse->type.
This whole function then ends up returning false, which naturally has no parse() method ;)

Would it be possible to throw Exceptions at the plases you just return nothing from the function? Or are we still bound to php4?
I see some other scenarios where this error could show up, where you in line 79 presumes you get a class back, when you in several fault cases don't return anything.

I'm using ctools 1.0 Aug 19 and eparser 1.0 8 Sep on Drupal 6.12.

Edit: Some typos

emTque’s picture

I get the same error, using:
- ctools 6.x-1.0
- eparser 6.x-1.0

I also no other parsers installed.

summit’s picture

Same problem, newest feedapi, newest ctools, greetings, Martijn

b-prod’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Status: Postponed (maintainer needs more info) » Needs work
StatusFileSize
new1.04 KB

Hi!

I work with the dev version. For this version the problem is the same, but with method fetch() instead of parse(). Actually the method is called without checking before if the object has been instanciated.

So I have added a simple check which returns FALSE (so feedAPI module will display an error message too) and displays an error message with a link to the settings tab.

The patch below works for DEV version, but for the released version the only thing to change is the name of the method as explained above.

killes@www.drop.org’s picture

+++ feedapi_eparser.module	29 Sep 2009 13:23:34 -0000
@@ -77,7 +77,13 @@
+          drupal_set_message(t('You have to specify the eParser settings in the suitable !tab.', array('!tab' => l(t('tab'), "node/$feed->nid/eparser"))), 'error');
+          return FALSE;

The error message doesn't make proper use of the t() function. The proper way is to include the html tags inthe message.

This review is powered by Dreditor.

b-prod’s picture

StatusFileSize
new1.06 KB

Here is a new patch with a valid use of t() function (thanks to killes).

I also changed the type of message displayed to warning instead of error, which seems to be more appropriate.

neclimdul’s picture

Status: Needs work » Fixed

Looks good to me. You could have probably update the issue it to needs review with your last patch though :-D

Thanks! Committed.

Status: Fixed » Closed (fixed)

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