This problem is happening, when I try to import an importer with existing id. It only happens when original importer wasn't saved into db (i.e. in code). I think this is a bug. We should always show validation message, if "Replace an existing importer if one exists with the same id." isn't ticked.

The patch is attached.

Comments

alan-ps created an issue. See original summary.

megachriz’s picture

The form to import Feeds importers was modelled after how Views deals with importing/overriding views.

Appearantly, Views will just import the view with no warning if you import one that overrides a default view, even if you don't check the option "Replace an existing view if one exists with the same name". This option was added in #421842: Allow imported views to overwrite existing views. Before that, views saved in the database could not be overriden using the import form, but default views still could. The option were default views could be overriden using the import form was added with the rest of the import form logic: http://cgit.drupalcode.org/views/commit/?h=master&id=1008b7ff61e47df3452...

Anyway, to me it looks like #421842: Allow imported views to overwrite existing views overlooked to validate the possibility that default views could get overwritten with a new imported view and that it wasn't intentional.

Seems like this is an issue in both Feeds and Views. Opinions?

megachriz’s picture

Reuploading the patch from the issue summary so it will be evaluated by the testbot.

alan-ps’s picture

Thanks for your response. Created appropriate issue for views module: https://www.drupal.org/node/2708503

  • MegaChriz committed 11697a5 on 7.x-2.x
    Issue #2704825 by alan-ps, MegaChriz: Fixed import Feeds importer...
megachriz’s picture

Status: Needs review » Fixed

I've waited for a response on #2708503: Import views ignores validation. to hear for any arguments against this change, but no one responded on that and I'm fine with the change. Should there come a good argument on that issue, we can always revert this change.

Committed #3.

megachriz’s picture

Woops, I had meant to make you the commit author. Sorry :$.

alan-ps’s picture

Thanks :)

Status: Fixed » Closed (fixed)

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