Needs work
Project:
Migrate
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Aug 2012 at 12:15 UTC
Updated:
19 Mar 2019 at 15:01 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
joachim commentedHere's a work in progress patch.
It works, and adds:
- a relationship from entity base tables to map tables for any migrations into that entity
- a field for the source id
Needs work:
- This just shows the first sourceID for now, and assumes it's numeric. Needs work to expose all source id fields using the appropriate handler
- MigrateDestinationEntity somewhat messily needs to be told the map table. I couldn't see how to get the name of the map table from within the destination class.
- similarly, MigrateDestinationEntity needs to get the migration details to show the description in the Views data help text.
Comment #2
mikeryanI don't see how this can do anything, with hook functions named hook_views_data_alter() - how would the hooks be invoked?
I think the destination handler is the wrong place to implement this - it should be the map classes, since they manage the map table, you could add info functions to the destination handler to be invoked by the map implementation.
Comment #3
joachim commented> hook functions named hook_views_data_alter() - how would the hooks be invoked?
The hook functions named hook_views_data_alter() are in the classes, and get called by the actual hook_views_data_alter().... which I seemed to have missed off in my patch!!
(This is a standard pattern for Views, btw: views handler classes have methods like hook_menu() to return data for views_menu() for the handler.)
> I think the destination handler is the wrong place to implement this - it should be the map classes
So the chain would go:
- actual hook implementation
-- map class
--- destination handler
Seems fair enough to me, though I could do with hints on how to reach one class from the other, such as the migration class.
Comment #4
joachim commentedDid a search to see if anyone had worked on this, and what do you know, I did, 3 years ago! :)
Comment #5
joachim commentedAnd it turns out the file I missed off in the patch from 3 years ago is sitting on my hard drive because I hadn't got round to deleting the project it was written for :)
Here's a complete patch.
Just tested it with a node migration -- works great. I can build a view of nodes and add the relationship to the map table, set it to 'required' and I've got an audit view :)
Comment #7
joachim commentedArgh. Forgot to roll relative.
Comment #8
gedur commentedNice patch, I've tested it and added new features:
- Added other migrate fields: last import, destiny id, hash, rebuild
- Possibility to use it as main table
Attacing patch please review
Comment #10
gedur commentedSorry, wrong patch (it removes the new views.inc file). Attache the right one
Comment #12
omarlopesinoPatch #10 worked for me! It was nice to see this view while I was migrating some content.
Thanks!
Comment #13
crzdev commentedNew patch working with the latest version