Active
Project:
IMP
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
27 Oct 2013 at 00:21 UTC
Updated:
10 Nov 2013 at 04:45 UTC
Jump to comment: Most recent, Most recent file
Use the filter format as an example on how to use prepareRow to expand this:
http://drupalcode.org/sandbox/chx/2105305.git/blob/HEAD:/lib/Drupal/migr...
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | imp-include_profile_user-2121359-11.patch | 1.96 KB | fastangel |
| #8 | imp-include_profile_user-2121359-8.patch | 1.53 KB | fastangel |
| #5 | imp-include_profile_user-2121359-5.patch | 1.52 KB | fastangel |
Comments
Comment #1
fastangel commentedI created a first version. I attach the patch. And some questions:
1.- Profile module is a optional module. Should we check if the table exist or check in table system if module is enable?
2.- Should we check in functions fields the name of profile fields to add the info?
Regards.
Comment #2
chx commentedI am so sorry, my reply didn't get posted :/
What's timezone_name? I just removed that.
1. Do we need a "requirements" plugin type? Or is this a source-y method? Good question!
2. fields() is not horribly important at this point, leave it.
I have a question too -- while I havent looked at profile in like five years, wasn't there some serialization going on here or there?
Comment #3
fastangel commentedSorry I don't know because I changed timezone XD I attach a new patch with this change removed.
I wait a little discussion for the first question for continue working here.
About your last question. I have installed a drupal 6 for do test and check the information. I thought the same but checked the database and we don't have any serialize data.
Comment #4
marvil07 commentedremove, right? ;-)
1. since source's should be kind of low level it is about deciding what to do: migrate data of installed/disabled modules of prefer status module, I guess trusting on the module status would be better. I would say that it is a good idea to add an intermediary ancestor between SqlBase and the real sources, so we can add some extra methods there(maybe even three: DrupalSqlBase/D6SqlBase/D7SqlBase), i.e.
isModuleEnabled($module), @chx, what do you think?2. please leave a todo there so we do not forget please
About serialization, yes it's a little tricky to find but there is one profile field that needs (un)serialization: date ;-), so it's an extra conditional on the retrieval loop(see d6's
_profile_field_serialize()).Comment #5
fastangel commentedOk removed :
$ = array.Added todo comment to fields function.
Added special case for date field.
NOTE: waiting about implement a moduleEnable method or not.
Comment #6
fastangel commentedComment #6.0
fastangel commentedUpdated issue summary.
Comment #7
marvil07 commentedCan we just make a join instead of 1+N queries?
About isModuleEnabled, it's now implemented at
Drupal6SqlBase::moduleExists(), so you want to call that at the start of prepareRow().About fields, it's about making another query on fields, I will definitely suggest to do that on another method with a local static cache.
Comment #8
fastangel commentedUpdated with the last change. About your last comment. Do you say create a new method for example fieldProfile or similar?
Comment #9
chx commentedI would say add requirements() and then later we can add an interface which this will already implement.
Comment #10
chx commentedApparently RequirementsInterface has been added and you implemented it in the other issue. Please do here as well. Thanks!
Comment #11
fastangel commentedI added the change of your last comment. About implement requirement function. Do you think that we need to implement?. I think that we need to check profile in prepare row because a migration of user can be without profile then profile isn't a requirements. Is right?
Comment #12
chx commentedAh, yes, you are completely right, it's not a requirement. I have committed this, now let's add a test for it. Thanks!