For each content set, create default views comparing input data to corresponding Drupal output data based on the content set mappings.

Comments

moshe weitzman’s picture

Version: » 6.x-1.x-dev

I'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.

moshe weitzman’s picture

perhaps 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.

mikeryan’s picture

StatusFileSize
new1.97 KB

I 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...

mikeryan’s picture

Status: Active » Closed (won't fix)
moshe weitzman’s picture

Title: Default audit views » Default audit Views
Version: 6.x-1.x-dev » 7.x-2.x-dev
Assigned: mikeryan » Unassigned
Category: task » feature
Status: Closed (won't fix) » Active

Sorry 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.

  1. Provide Views integration for the map tables. We would do so when the destination is well known like node/comment/term/user
  2. Provide default views for map table browsing. Include an exposed field sourceIds and DestiIDs. The main benefit is that we quickly can browse migrated node/comment/user data
  3. Provide a new property of source keys which is an URL pattern like ticket URLs. That way we can link back to a web page detail for each Source item.
  4. Once we have above, implement hook_entity_view_alter which appends this link to Drupal migrated content.
  5. Once we have above, views enable the message table since we get nice hyperlinks back to Source web page.

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.

moshe weitzman’s picture

FYI, 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.

fgm’s picture

You 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.

Fidelix’s picture

Subscribing... this would be awesome.

drewish’s picture

Oh... 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.

jpklein’s picture

StatusFileSize
new12.91 KB

As 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.

joachim’s picture

Issue summary: View changes

I'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.

joachim’s picture

Status: Active » Needs review
StatusFileSize
new4.1 KB

Here'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.

joachim’s picture

Updated patch:

- adds a title to the view
- adds a field for the entity ID

pifagor’s picture

Status: Needs review » Reviewed & tested by the community

  • pifagor committed f838b27 on 7.x-2.x authored by joachim
    Issue #392434 by joachim, jpklein, mikeryan, moshe weitzman, fgm,...
pifagor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

joseph.olstad’s picture