When attempting to change the settings for Feeds Directory Fetcher, the following form error messages appear upon form submit:

Notice: Undefined index: directory in FeedsFileFetcher->configFormValidate() (line 274 of /var/www/html/glendalecc/sites/all/modules/contrib/feeds/plugins/FeedsFileFetcher.inc).
Notice: Undefined index: allowed_schemes in FeedsFileFetcher->configFormValidate() (line 275 of /var/www/html/glendalecc/sites/all/modules/contrib/feeds/plugins/FeedsFileFetcher.inc).
Warning: array_filter() expects parameter 1 to be array, null given in FeedsFileFetcher->configFormValidate() (line 275 of /var/www/html/glendalecc/sites/all/modules/contrib/feeds/plugins/FeedsFileFetcher.inc).
Notice: Undefined index: direct in FeedsFileFetcher->configFormValidate() (line 277 of /var/www/html/glendalecc/sites/all/modules/contrib/feeds/plugins/FeedsFileFetcher.inc).
Please specify an upload directory.

The issue is that the feeds_fetcher_directory_fetcher class is inheriting the configFormValidate() method from the parent class, FeedsFileFetcher, but that method ought to be overridden in the child class. This is because the validation function in the FeedsFileFetcher class checks for form values in configForm() that do not exist in feeds_fetcher_directory_fetcher's implementation of configForm().

Attached is a patch that addresses the configFormValidate() issue. This patch also adds a configuration option on the importer for setting the directory, so that the directory does not have to be set on the sourceForm. This is provided for convenience and to reduce the confusion of users when they set up the feed (see for example, #2002244: How to specify directory? Is something broken?).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jeqq’s picture

Status: Needs review » Reviewed & tested by the community

Patch works for me. Thanks.

gurvan’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Patch works well for me, can it be implement on the module ?

vlad.dancer’s picture

+1 RTBC! Thx alot!

Steven Jones’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

Steven Jones’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch and reviews.

Status: Fixed » Closed (fixed)

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