diff --git a/plugins/FeedsFileFetcher.inc b/plugins/FeedsFileFetcher.inc index 145c93c..88292ae 100644 --- a/plugins/FeedsFileFetcher.inc +++ b/plugins/FeedsFileFetcher.inc @@ -234,8 +234,15 @@ class FeedsFileFetcher extends FeedsFetcher { $form['delete_uploaded_file'] = array( '#type' => 'checkbox', '#title' => t('Immediately delete uploaded file after import'), - '#description' => t('Useful if the file contains private information. If not selected, the file will remain on the server, allowing the import to be re-run without having to upload it again.'), + '#description' => t('Useful if the file contains private information. If not selected, the file will remain on the server, allowing the import to be re-run without having to upload it again. This setting has no effect when the option "@direct" is enabled.', array( + '@direct' => t('Supply path to file or directory directly'), + )), '#default_value' => $this->config['delete_uploaded_file'], + '#states' => array( + 'disabled' => array( + ':input[name="direct"]' => array('checked' => TRUE), + ), + ), ); $form['direct'] = array( '#type' => 'checkbox', diff --git a/tests/feeds_fetcher_file.test b/tests/feeds_fetcher_file.test index 4362b15..089c7c0 100644 --- a/tests/feeds_fetcher_file.test +++ b/tests/feeds_fetcher_file.test @@ -41,8 +41,8 @@ class FeedsFileFetcherTestCase extends FeedsWebTestCase { * Test scheduling on cron. */ public function testPublicFiles() { - // Straight up upload is covered in other tests, focus on direct mode - // and file batching here. + // Straight up upload is covered in other tests, focus on direct mode and + // file batching here. $settings = array( 'direct' => TRUE, 'directory' => 'public://feeds', @@ -79,8 +79,8 @@ class FeedsFileFetcherTestCase extends FeedsWebTestCase { * Test uploading private files. */ public function testPrivateFiles() { - // Straight up upload is covered in other tests, focus on direct mode - // and file batching here. + // Straight up upload is covered in other tests, focus on direct mode and + // file batching here. $settings = array( 'direct' => TRUE, 'directory' => 'private://feeds', @@ -124,7 +124,8 @@ class FeedsFileFetcherTestCase extends FeedsWebTestCase { } /** - * Tests if files can be removed after import when running the import in background. + * Tests if files can be removed after import when running the import in + * background. */ public function testRemoveFileAfterImportInBackground() { // Configure to import in background and import as often as possible. @@ -164,11 +165,13 @@ class FeedsFileFetcherTestCase extends FeedsWebTestCase { '@count' => $node_count, ))); - // Assert that the file to import still exists as the import hasn't finished yet. + // Assert that the file to import still exists as the import hasn't finished + // yet. drupal_flush_all_caches(); $this->assertTrue(file_exists('private://feeds/nodes.csv'), 'The imported file still exists.'); - // Run cron again to import the remaining 4 nodes and assert that 9 nodes exist in total. + // Run cron again to import the remaining 4 nodes and assert that 9 nodes + // exist in total. $this->cronRun(); $node_count = db_select('node') ->fields('node', array()) diff --git a/tests/feeds_tests.module b/tests/feeds_tests.module index 5ae8c95..9844ae1 100644 --- a/tests/feeds_tests.module +++ b/tests/feeds_tests.module @@ -65,7 +65,7 @@ function feeds_tests_theme() { * * Changes runtime limit for feeds_source_import queue. * - * @see FeedsFileHTTPTestCase::testImportSourceWithMultipleCronRuns() + * @see FeedsFileFetcherTestCase::testRemoveFileAfterImportInBackground() */ function feeds_tests_cron_queue_info_alter(&$queues) { $feeds_source_import_queue_time = variable_get('feeds_tests_feeds_source_import_queue_time', FALSE); @@ -400,7 +400,7 @@ function feeds_tests_feeds_after_parse(FeedsSource $source, FeedsParserResult $r /** * Implements hook_feeds_after_save(). * - * @see FeedsFileHTTPTestCase::testImportSourceWithMultipleCronRuns + * @see FeedsFileFetcherTestCase::testRemoveFileAfterImportInBackground() */ function feeds_tests_feeds_after_save() { $sleep = variable_get('feeds_tests_feeds_after_save_sleep', FALSE);