Question

I am attempting to develop a Drupal module that defines the class MyFeedsSyndicationParser. This class extends the class FeedsSyndicationParser from the Feeds module. In my module's .info file the dependency on the Feeds module is identified.

When I enable the module the php_error.log contains: PHP Fatal error: Class 'FeedsSyndicationParser' not found in C:\wamp\apps\myapp\sites\all\modules\custom\myfeeds\MyFeedsSyndicationParser.inc on line 9

It seems that the FeedsSyndicationParser class has not yet been defined. Does Drupal have an API call that can be used to ensure that another module has been loaded? (In this case, the FeedsSyndicationParser.inc file.)

Was it helpful?

OTHER TIPS

There are two (better/proper) ways to do this.

  1. list it as a dependency in your .info file, so that it wont enable without it.
  2. use module_exists() to check if the module is installed & enabled (for say a views date filter that can optionally use the Date_API if it is present and enabled)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top