I've got a very weird problem :
I'm using feeds for a project :
http fetcher (custom module to produce the csv)
csv parser

on localhost, everything's going fine and work well
wamp : PHP 5.2.11 / mysql 5.X / Apache 2.X

on the production server, I've got a strict warning on any page involving feeds (I mean, a node as an instance of feeds or a page of param)
PHP 5.2.17 / mysql 5.X / Apache 2.X
The immediate consequence is that the import is not working
Strict warning : Declaration of FeedsSource::instance() should be compatible with that of FeedsConfigurable::instance() dans _registry_check_code() (ligne 2811 dans D:\Apache\htdocs\veolia\includes\bootstrap.inc).

Comments

arnaud.ranson’s picture

Status: Active » Closed (cannot reproduce)

I forgot to tell that the cache was resetted several times

Anyway, the problem no longer exists

I can't explain why ... but I close the issue because even for me, it's impossible to reproduce

johnbarclay’s picture

Version: 7.x-2.0-alpha3 » 7.x-2.x-dev
Status: Closed (cannot reproduce) » Active

I can reproduce this. The problem is

feeds/includes/FeedsSource.inc -- public static function instance($importer_id, $feed_nid = 0)

has a different handle than

feeds/includes/FeedsConfigurable.inc -- public static function instance($class, $id)

Simply changing the second arg to have the same a default or no default in both cases takes care of this.

Its caused by string needing inherited methods to have same handles.

dqd’s picture

I can reproduce this too. I have uninstalled Panels and have changed from 5.3 cgi mode back to 5.2 php mode on shared hosting space short before suddenly this error message has occured afterwards.

@johnbarclay: So did you made a hack (code change) on your installation? And can you please show your 2 lines of code for all of us? I also would like to know which of the to possibilities you took and why.

thanks in advance

dqd’s picture

Title: Strict warning » Warning: Declaration of FeedsSource::instance() should be compatible with that of FeedsConfigurable::instance()
Issue tags: +incorrect php version, +warning, +FeedsSource::instance(), +FeedsConfigurable::instance()

ok after switching back to php5.3-cgi mode the error goes away. It seems to be a dependend issue under different php5.x versions. Maybe feeds is optimized for php 5.3?

dqd’s picture

Priority: Normal » Critical

+critical because users who run drupal in php5.3 cgi mode for development and want to switch back for site release and better production site performance can have issues with it. Most shared hosters support cgi mode under php 5.3 and non cgi mode under lower 5.x version of php only.

dave reid’s picture

Priority: Critical » Normal

Sorry, but that's a complete abuse of the critical priority. It's just a warning that we can fix but doesn't prevent the module from working completely. The import is not working because of something else, not because of the strict error.

dqd’s picture

Sorry for that. It was not my intension to give it a higher priority rather than to warn users using this road. My understanding of critical was if an error occures on frontpage frequently and is higher leveled than a notice. It even occures when feeds is enabled only and not in use. My intension was not about the import which is not working for the thread starter rather than for the repeating error on frontpage which seems to me more problematic than a index warning.

Thanks for clearifying and sorry for my missleading priority change.

kind regards

dqd’s picture

Thanks for fixing it, Dave.

Awesome module, by the way. And I can submit that the import works even with the error.
greetings from Berlin

dqd’s picture

I hate talking to myself :) but ok, we all haven't enough time. I absolutely feel that. To be a little bit more positive, here is the exact code change for all who may wanna try to prevent the error warning popping up again and again. I hope Dave has some time to put this in the next dev shot, so we don't need to remember our hack after updating.

Warning: This is a manual code change in the module folder without a long testing phase from more than 2 users and will be lost after updating! I only can confirm that it works over here.

  • navigate to and open sites/all/modules/feeds/includes/FeedsConfigurable.inc
  • navigate to line 52 public static function instance($class, $id)
  • change it this way:
public static function instance($class, $feed_nid = 0) { 
// MANUAL HACK! second argument used to be simply $id, but has caused an error warning

It resets the second argument rather than just using the default $id. Like mentioned above from johnbarclay, there are two possibilities. Thanks to him for pointing to the right direction. If it breaks something else later on, we try the other way around. Therefore we should better change the second argument in code line 52 back to

public static function instance($class, $id) { // $id is here again 

first and then change the second argument somewhere else to the default $id :

  • navigate to and open sites/all/modules/feeds/includes/FeedsSource.inc
  • navigate to line 185 public static function instance($importer_id, $feed_nid = 0) {
  • change it this way:
public static function instance($importer_id, $id) { 
// MANUAL HACK! second argument used to be simply $feed_nid = 0, but has caused an error warning

Summary: Try the first OR the second change ONLY and go ahaed working on your site development. The error warning from the thread start will not be there no more. But if feeds start to behave unlikely later on you may try the other way around. For me the second worked better. The first has turned out an error with editing in views.

For the tired, beware the curved bracket. There should be an opening one (only ONE!) after, like it was before. :)

dave reid’s picture

twistor’s picture

Status: Active » Closed (fixed)

Looks like Dave forgot to mark this issue fixed. Closing since it's been done for more than a year.