For each content set, create default views comparing input data to corresponding Drupal output data based on the content set mappings.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 392434.13.migrate.default-audit-views.patch | 4.74 KB | joachim |
| #12 | 392434.migrate.default-audit-views.patch | 4.1 KB | joachim |
| #10 | migrate-imported_nodes_view-392434-10.patch | 12.91 KB | jpklein |
| #3 | migrate.views_default.inc_.txt | 1.97 KB | mikeryan |
Comments
Comment #1
moshe weitzman commentedI'm not sure this is possible. have folks been making Audit views to review after a migration? If so, can you think of a way to automate them? It might be nice to ship with an example of an audit View just to spur ideas.
Comment #2
moshe weitzman commentedperhaps possible if the conten set query gets exposed either as a base table in Views. a mysql View (not a drupal View) representing the content set might be handy here.
Comment #3
mikeryanI envision doing it by cloning the content set view, and adding joins to the ultimate destination table via the map table. This would require, I think, another destination hook to get the necessary destination table info.
I'm working now on #392416: Integrate migration messages with views, which is the same concept but simpler - clone the content set and add a join to the _msgs table. Note that "simpler" is relative - I have worked out the cloning part (the tricky thing here is you can't load a default view within hook_views_default_views(), and in hook_views_default_views_alter() you can't load non-default views). So, I have to implement both hooks, with the first one handling content sets which are custom views, and the second handling those which are default views, calling a common function to do the heavy lifting. Haven't made much progress on that heavy lifting, though... I'm going away on vacation soon and probably won't get to this first, so if any Views API wizards want to pick up on it, I'll attach what I've got...
Comment #4
mikeryanComment #5
moshe weitzman commentedSorry to revive an old issue.
I'd propose we start small and bring back a little Views into our world. Here is what I have in mind for a migrate_views module. Can be phased in.
This issue is *not* about fetching source data using Views (like Migrate 1). Thats cool too, but not an interest of mine. I'm not sure I will work on this issue either, but I'd like to lay out a plan.
Comment #6
moshe weitzman commentedFYI, CTools and soon Views are going to auto-build relationships based on foreign keys as defined in hook_schema. See #951048: Support Subtypes for Arguments, Context and Relationship plugins. So we should declare these foreign keys for our map tables.
Not sure we can wait for that to percolate through to a Views release, but it is cool.
Comment #7
fgmYou can look at the views in the migrate_remote (currently sandbox) module. Although these are not those being discussed, it does add some Views support within the migrate context.
Comment #8
Fidelix commentedSubscribing... this would be awesome.
Comment #9
drewish commentedOh... this would be good. I'd written a drush command to pull some random rows and build URLs for the source and destination but that really could be done more elegantly as a view... For my command I'd added two new properties to the migration class that serve as replacement patterns for the source and destination URLs. We could use those or just have the admin edit them in the view.
Comment #10
jpklein commentedAs a first step toward a full implementation, here's code for a submodule that re-renders values in the dashboard ui's "imported" column as links to a view of all nodes created by that migration. Just patch and enable the "migrate_ui_imported_nodes" module. Currently working with Migrate UI 7.x-2.4 and Views 7.x-3.5.
Comment #11
joachim commentedI've posted a patch to #1762046: views integration for map tables which adds Views support to the map tables, as a first step towards providing default views.
Comment #12
joachim commentedHere's a patch which adds a default view for each migration that supports it -- the migration must use the SQLMap, and have an entity destination.
It requires the patch from #1762046: views integration for map tables.
The views are pretty basic, as there's not much that cane be done for a generic entity type. I've copied the code from the Views UI wizard which automatically chooses one 'best' field for any entity type view -- eg for nodes, it adds the node title.
Comment #13
joachim commentedUpdated patch:
- adds a title to the view
- adds a field for the entity ID
Comment #14
pifagorComment #16
pifagorComment #18
joseph.olstadhttps://www.drupal.org/project/migrate/releases/7.x-2.12