Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
not sure if this is a support request, feature request or bug report.
how do i import a tamper config export? (please don't say using Features.. ughh).
Comment | File | Size | Author |
---|---|---|---|
#36 | easyconfigimport_1946222_36.patch | 4.01 KB | NWOM |
|
Comments
Comment #1
Nodz CreditAttribution: Nodz commentedI'm interested in this too.
Feeds offers a hook for importing feed set ups via modules (like the example feeds import).
Having a similar hook for importing feeds tamper plugin setups via file would allow creating self contained modules for an import with both feeds and feeds_tamper settings.
I'll look and see if there is such a hook or if one could be easily implemented.
Comment #2
meecect CreditAttribution: meecect commentedAny update on this? It would be very useful. Here is a code snippet of a similar function in the feeds module:
assuming your feeds importer config (that you exported) is $feeds_importer:
A similar API for feeds tamper would be nice.
Comment #3
jgutix CreditAttribution: jgutix commentedYou need to implement
hook_feeds_tamper_default
, like this:Then in order to your function be executed you should declare like this:
Here you have a complete example
Comment #4
liquidcms CreditAttribution: liquidcms commentedstill no progress?
Comment #5
liquidcms CreditAttribution: liquidcms commentedIdeally i think the Feed export should contain the Feed Tamper export; would that not make the most sense here? This way, a feed export is completely self-contained - and it also would fix this issue where there is no feed tamper importer (which is pretty silly to have an exporter with no importer).
Comment #6
twistor CreditAttribution: twistor commented#3 is correct, the export mechanism is meant for creating a custom module.
We could add an import form, I guess, but using Features or a custom module is really the way to go.
If somebody wants to implement this, I am willing to commit it.
Comment #7
ajf__ CreditAttribution: ajf__ commentedI've created a module for my Feeds Tamper default using the code above as a guide and replacing the dummy Feeds Tamper export code with my own.
I enabled my module and cleared all caches, but I don't see any difference in the Feeds Tamper UI. The blank defaults are still there.
Is there another step I'm missing?
All I hope to achieve is duplicate an existing Feeds Tamper config.
Comment #8
komlenic CreditAttribution: komlenic as a volunteer commentedajf__ I can confirm that the code in #3 works. Be aware that you do need to add "return $export;" at the end of the MYMODULE_feeds_tamper_default() function, after you paste the code provided by the export tab of the feeds tamper ui interface.
Comment #9
liquidcms CreditAttribution: liquidcms commentedsorry guys.. #3 is not the way to do this and it is not the solution for what i was asking.
like most things which have an exporter; they also have an importer (importer form as twistor mentions in #6) - writing a custom module to import setup.. really??
and, as i suggested above, the best way for this seems to be that the feeds config exporter include the tamper export and then the feeds importer (already an importer form for this) use that "complete" export to build both the feed and tamper config.
never looked at importer/exporter code but perhaps i should take a look.. :)
Comment #10
iyyappan.govindHi
We already have feeds tamper plug-in export in the tamper page of the feeds importer. So i have implemented module called feeds tamper plug-in importer.
Please check this link:
https://www.drupal.org/node/2597207
Thanks
Comment #11
iyyappan.govindComment #12
parisekiyyappan govind Please create patch from your project application https://www.drupal.org/node/2597207 I'm looking forward for your contribution!
Comment #13
iyyappan.govindParisek thanks for your suggestion. I have created the patch for feeds tamper plug-in importer.
Comment #15
iyyappan.govindI have created the updated patch for feeds tamper plug-in importer.
Comment #16
Abelito CreditAttribution: Abelito commentedThe patch in #15 works great! I haven't found any problems with it.
Thanks @iyyappan-govind
Comment #17
liquidcms CreditAttribution: liquidcms commentedNot sure why the push back to not have this included as part of Feeds importer/exporter. Do people use a Feeds Tamper without Feeds? Only reason I can think of why this would need to be a separate tool.
Comment #18
parisekliquidcms You're right, nobody uses Feeds Tamper without Feeds, but this issue is for Feeds Tamper module. Your proposal must be resolved in Feeds module, feel free to open new issue. In the meantime we have a working patch so please do not change topic and hopefully it will be merged soon.
Comment #19
liquidcms CreditAttribution: liquidcms commentedbtw.. i am original poster... so pretty sure i'm allowed to change topic.. :)
and yes, nice to have something added to Feeds Tamper.. but if its the wrong way to do it; why bother?
Comment #20
parisekI'm sorry, didn't notice that. But how could Feeds Tamper alter Feeds export? I think it's not possible.
Generally it's better to have some solution then no solution:-) But final word is up to module maintainer.
Comment #21
deshunda.white CreditAttribution: deshunda.white commentedThe patch from #15 worked great for me. There are only 2 points I'd like to make. The first point are for individuals who are manually applying this patch. In the patch provided it isn't 100% clear which other file needs to be edited for the second part of the patch. The first part is [@@ -59,6 +59,17] refers to feeds_tamper_ui.module. The second part [@@ -215,3 +226,96] refers to feeds_tamper_ui.admin.inc in the feeds_tamper folder.
Secondly if the order of the plugins are critical for a certain functionality you will need to rearrange the plugins since the export tamper functionality presents the plugins in reversed order. For me I had to rearrange the Rewrite and Explode plugins for my content to present properly.
Comment #22
hargobindThis patch works great!
The only thing that's missing is the "override" checkbox that you see in other import pages (e.g. Views import) that says something like "Replace an existing [item] if one exists with the same name".
Comment #23
iyyappan.govindHi,
@hargobind thanks for your review ...i will do the "override checkbox".
Thanks,
Comment #24
portulacaThank you for the patch #15, it works (don't forget to clear cache).
Comment #25
checker CreditAttribution: checker commentedConfirm this patch works without any issues (also order is correct).
I guess it is not necessary to add an override option. This should be a new feature request.
Comment #26
NWOM CreditAttribution: NWOM commented#15 worked amazingly. It saved me at least an hour of work. Thank you!
Comment #27
g33kg1rl CreditAttribution: g33kg1rl commentedI tried the patch in #15 and I received this error message after clearing the cache and going to the import page
Notice: Undefined index: feeds_tamper_ui_import_form in drupal_retrieve_form() (line 806 of /var/aegir/platforms/$platformname/includes/form.inc).
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'feeds_tamper_ui_import_form' not found or invalid function name in drupal_retrieve_form() (line 841 of /var/aegir/platforms/$platformname/includes/form.inc).
Comment #28
joseAyudarte91 CreditAttribution: joseAyudarte91 commentedHi,
May be it is a silly question but, ¿Does have anyone checked the patch with the 7.x.1.1 (current release) version?.
Many thanks and best regards,
Jose
Comment #29
bisonbleu CreditAttribution: bisonbleu commentedPatch in #15 works as advertised. Good work @iyyappan.govind!
One thing, tamper settings associated to an importer are not deleted when the importer is deleted. You have to uninstall tamper to do that - WARNING in doing so, ALL tamper settings are deleted.
It would be nice, and make for a more coherent UX, if the child tamper settings were automatically deleted when the parent importer is deleted.
Cheers
Comment #30
iyyappan.govind@bisonbleu Thanks for reviewing this patch . Sure i will do the changes.
Comment #31
iyyappan.govind@bisonbleu ,
Feeds tamper settings is deleted. Please check the patch with feeds module version 7.x-2.0-beta2 and feeds_tamper module version 7.x-1.1.
Please let me know if you have any issues
Thanks,
Comment #32
droweski CreditAttribution: droweski commentedPatch in #15 works !!. Good work @iyyappan.govind!
Tested with:
Feeds: 7.x-2.0-beta2
Feeds Tamper: 7.x-1.1
Comment #33
geru CreditAttribution: geru commentedNice work iyyappan.govind. I like this patch.
I'm not sure how to patch a patch, but this patch really needs to assign the weight properly. Without this, multiple tampers will not be ordered correctly.
I have submitted a patch on your sandbox site https://www.drupal.org/sandbox/iyyappangovind/2597049
Basically, a single line needs to be added:
just before the feeds_tamper_save_instance()
Thank you.
Comment #34
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedRestoring issue title and category.
Comment #35
puddyglumpatch in #15 worked perfectly. rtbc?
Comment #36
NWOM CreditAttribution: NWOM commentedWhen applying #15 the following warning is shown:
easyconfigimport_1946222_0.patch:9: trailing whitespace.
I have fixed the whitespace error and added the change mentioned in #33. Please review.
Comment #37
garrettw CreditAttribution: garrettw at Encore Multimedia commented#3 really needs to be added to the documentation for this module. Could someone do that?