Issue fork feeds-3116987

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

martinpetracek.com created an issue. See original summary.

megachriz’s picture

Issue tags: +beta target

Yes, this is a thing still to be done indeed. It would be nice to have it done before the beta phase, so I added it as a beta target.

govind.maloo’s picture

Status: Active » Needs review
StatusFileSize
new3.6 KB

Hi @MegaChriz

I have created initial patch for this functionality.

lizuka’s picture

@goveind.maloo
Your patch works for me. Tested a couple of times so far with success.
Thanks.

andypost’s picture

Status: Needs review » Needs work
+++ b/src/Feeds/Processor/Form/DefaultEntityProcessorForm.php
@@ -71,6 +71,16 @@ class DefaultEntityProcessorForm extends ExternalPluginFormBase implements Conta
+      '#title' => t('Insert new @entities', $tokens),
+      '#description' => t('New @entities will be determined using mappings that are a "unique target".', $tokens),

could use $this->t() instead of t()

irinaz’s picture

Status: Needs work » Needs review

I tried to test this patch, but I am not sure what it is actually supposed to do - is there a new option in processor settings?

mchamps’s picture

@irinaz in your feed settings admin/structure/feeds/manage/FEEDSNAME
under Processor Settings there's a new option : Insert new product variations

I tested
- processors : Product & Product Variation
- fetcher : Upload file & Directory
- Parser : cvs

Works great for me! Thanks!

jcnventura’s picture

Status: Needs review » Needs work

Setting back to needs work as per #5

irinaz’s picture

@jcnventura, can you see updates from #5 in this fork https://git.drupalcode.org/issue/feeds-3116987/-/compare/8.x-3.x...31169... ? There is no additional patch for this change.

jcnventura’s picture

Indeed, but until you create a Merge Request, that issue fork is invisible here. Please do set it back to Needs Review when there's an MR to review.

irinaz’s picture

Status: Needs work » Needs review

@jcnventura, thanks for clarification, I created merge request and changed to "needs review".

jcnventura’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Thanks for the MR. The failing tests are also failing for the base module.

I think it only needs two things now:

  1. Tests
  2. For consistency sake, remove the FEEDS_ prefix from the new constants.
jcnventura’s picture

Status: Needs work » Needs review

@irinaz, thanks for that. The FEEDS_ prefix was still present in:

  • lines 79 and 80 of src/Feeds/Processor/Form/DefaultEntityProcessorForm.php
  • lines 41 and 48 of src/Plugin/Type/Processor/ProcessorInterface.php

I've removed those, and I hope that the tests will pass again

irinaz’s picture

@jcnventura, thanks for fixing it!

megachriz’s picture

I added test coverage for this feature. The tests are inspired by tests for the same feature in the D7 version: FeedsRSStoNodesTest::testSkipNewItems().

megachriz’s picture

I also flipped the constant values: SKIP_NEW now is 0 and INSERT_NEW now is 1. This is consistent with what the values were in the D7 version of Feeds:

// Insert mode for new items.
define('FEEDS_SKIP_NEW', 0);
define('FEEDS_INSERT_NEW', 1);

Taken from plugins/FeedsProcessor.inc from Feeds 7.x-2.x

jcnventura’s picture

Title: Don't create new items, only update existing (D8) » Only create new items, don't update existing (D8)

I guess that means the title should be like this then...

megachriz’s picture

Title: Only create new items, don't update existing (D8) » Don't create new items, only update existing (D8)

@jcnventura
No, not really. The new feature is that you can prevent Feeds for creating new content. Creating new items and don't update existing is a feature already available in Feeds.

megachriz’s picture

Hided the patch to decrease confusion, the latest code is in an issue fork now.

  • MegaChriz committed 4727325 on 8.x-3.x authored by irinaz
    Issue #3116987 by irinaz, MegaChriz, jcnventura, govind.maloo: Don't...
megachriz’s picture

Status: Needs review » Fixed

I inspected the code one more time and only made some small aesthetic changes.

The code has been merged!

Status: Fixed » Closed (fixed)

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