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?).
Comment | File | Size | Author |
---|---|---|---|
feeds_fetcher_directory-config-form-validate-errors.patch | 2.98 KB | danmuzyka |
Comments
Comment #1
jeqqPatch works for me. Thanks.
Comment #2
gurvan CreditAttribution: gurvan commentedPatch works well for me, can it be implement on the module ?
Comment #3
vlad.dancer+1 RTBC! Thx alot!
Comment #4
Steven Jones CreditAttribution: Steven Jones commentedComment #6
Steven Jones CreditAttribution: Steven Jones at ComputerMinds commentedThanks for the patch and reviews.