Comments

joachim’s picture

Status: Active » Needs review
StatusFileSize
new2.88 KB

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

mikeryan’s picture

Status: Needs review » Needs work

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

joachim’s picture

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

joachim’s picture

Issue summary: View changes
Parent issue: » #392434: Default audit Views

Did a search to see if anyone had worked on this, and what do you know, I did, 3 years ago! :)

joachim’s picture

Status: Needs work » Needs review
StatusFileSize
new4.43 KB

And 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 :)

Status: Needs review » Needs work

The last submitted patch, 5: 1762046.5.migrate.map-table-views-integration.patch, failed testing.

joachim’s picture

Status: Needs work » Needs review
StatusFileSize
new3.8 KB

Argh. Forgot to roll relative.

gedur’s picture

Nice 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

Status: Needs review » Needs work

The last submitted patch, 8: 1762046.8.migrate.map-table-views-integration.patch, failed testing.

gedur’s picture

Status: Needs work » Needs review
StatusFileSize
new6.54 KB
new3.62 KB

Sorry, wrong patch (it removes the new views.inc file). Attache the right one

Status: Needs review » Needs work

The last submitted patch, 10: 1762046.9.migrate.map-table-views-integration.patch, failed testing.

omarlopesino’s picture

Patch #10 worked for me! It was nice to see this view while I was migrating some content.

Thanks!

crzdev’s picture

New patch working with the latest version