Closed (fixed)
Project:
Feeds
Version:
8.x-3.x-dev
Component:
Feeds Import (feature)
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 May 2023 at 10:18 UTC
Updated:
29 Nov 2025 at 12:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
kopeboyComment #3
megachrizRelated D7 issue: #1984982: Allow sources to override the import period
Comment #4
andriy khomych commentedIt is an interesting feature request.
I'll try to work on it.
However:
1. Add an option on the feed type settings form to show the import period on the feed form.
2. Expose the import period setting on the feed form accordingly.
3. Add an option on the feed type settings form to allow chanding the import period on the feed form.
4. Add a permission to change the feed import period on the feed.
Option 3, I don't think is necessary. Either we are showing this option or not.
Comment #6
andriy khomych commentedSo, I've implemented a generic solution and attached the patch.
I skipped:
There are no separate field permissions on the feed edit form, so, better to keep it as it was designed.

Example of the configuration:
Comment #7
andriy khomych commentedAttached a new patch.
Comment #8
andriy khomych commentedHey Youri van Koppen!
It seems I need your help with
27.863s Drupal\Tests\feeds\Functional\Update\UpdateCustomSourcesUpdateTest 0 passed, 1 failed, 1 log(s)
28.017s Drupal\Tests\feeds\Functional\Update\UpdateNonExistentActionUpdateTest 0 passed, 1 failed, 1 log(s)
I was not able to fix them locally. And I'm open for your PR review.
Comment #9
andriy khomych commentedAttached a new patch.
Comment #10
megachriz@andriy khomych
Thanks for your work on this issue, I think I'll look at this after DrupalCon Vienna (which I'm attending).
Comment #11
klausiThanks, changes look good to me, the only thing missing is now the test fixing.
Comment #12
andriy khomych commentedHey Youri van Koppen!
I would appreciate your help with tests.
Let me know if I need to provide further improvements.
Comment #13
megachrizI see in that the two failed update tests are using the 'feeds-8.x-3.0-alpha6-feeds_installed.php' fixture, in which the tables 'feeds_feed' and 'feeds_subscription' are not installed. These table are installed in the fixture 'feeds-8.x-3.0-beta1-feeds_installed.php'. So I've added the tables to 'feeds-8.x-3.0-alpha6-feeds_installed.php' as well now. Let's see if that fixes the tests.
I hope to review/test your code soon! I would like to have that done by Sunday.
Comment #14
andriy khomych commentedHey Youri van Koppen!
Thank you! I appreciate your help!
Looking forward to your review.
It seems we have only to fix phpunit (previous minor) and phpunit (previous major) pipelines.
I think I can check over it after the MR review.
Comment #15
megachrizThanks for your work! I've added some comments on the MR in the GitLab interface.
Besides that, here is more from my review:
basePeriodicImportFieldDefinition()because of lacking context, I think that the label should be "Use the feed type default" there. And an override of the label (that also tells what the default import period is) could then be best implemented in\Drupal\feeds\FeedForm::form().I tested the import setting on the feed. When I set it on the feed to "As often as possible", while the feed type has "Every 1 hour", an import does indeed happen on every cron run. So this works!
I also tested setting the import setting on the feed first to "As often as possible" and then I disabled "Allows import period per feed". The first time I ran cron, an import happened (which is okay I think) and when running cron again a few times no more imports happened. So this works good as well.
I think it can be useful to have tests also for the following:
I have suggested a few more tests on the MR.
Comment #16
andriy khomych commentedComment #17
andriy khomych commentedHey Youri van Koppen!
Yes, and I used "Use the feed type default" due the lack of context, feel free to verify it.
Thanks for testing, glad to hear that it works.
Added 2 more tests.
Also, I was not able to fix failing pipelines, and looking forward to your support:
- https://git.drupalcode.org/issue/feeds-3363508/-/jobs/7097431
- https://git.drupalcode.org/issue/feeds-3363508/-/jobs/7097430
- https://git.drupalcode.org/issue/feeds-3363508/-/jobs/7097432
Comment #18
megachrizI've done a new review!
Failing tests
I've checked the failing test and added
$this->printMessages();right before the failing line.printMessages()is a method defined in FeedsCommonTrait and can reveal why an import failed by printing the error messages that were made during the import.The error message said:
I found out that the failing tests are related to these pieces of code in
Feed::basePeriodicImportFieldDefinition().Commenting out the setDescription() call made the test pass on Drupal 10. I think rendering this element in a Kernel test doesn't work or at least it is causing issues.
I propose to move the description of the field to
FeedForm::form(). And in the form code, the call to renderRoot() will not be needed.Comment #19
andriy khomych commentedHey Youri van Koppen!
Regarding:
I've reworked the description and updated period logic into a common helper to reuse it in common places.
Looking forward to your review!
Comment #20
andriy khomych commentedComment #21
megachrizThanks for the update! I hope to review your work this Thursday or else Saturday.
Comment #22
megachrizI think that this is good to go! Changes that I made:
CronTest::testImportPeriodPerFeed()a bit more and also added a few more comments in the test.Is it good to go for you too?
Comment #23
andriy khomych commentedThanks, Youri van Koppen!
I'm fine with this; feel free to merge it.
I've also attached an updated patch.
Comment #24
megachriz@andriy khomych
Thanks for confirming! Also thanks for your contribution and your patience to get this issue resolved. I scheduled the MR for merging.
Comment #27
andriy khomych commentedIt seems GitLab creates a patch only for the first commit.
I added an updated patch based on the diff.
Comment #28
andriy khomych commentedI added a patch for the 3.0 version (it does not include tests)
Comment #29
andriy khomych commentedAttached the updated 3.0 version patch with a fix for the interval set.