Posted by frankcarey on January 19, 2010 at 9:37pm
11 followers
| Project: | User Points |
| Version: | 7.x-1.x-dev |
| Component: | Code: userpoints |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
OK, I moved this out from migrate_points and removed the submodule. I did not add this to hook_migrate_api() because it is still waiting on a userpoints patch from april. If people could help test that and get it committed, we'll test this and finish it up.
#441678: Use drupal_write_record(). Needed to be able to import transactions with migrate_extras
Comments
#1
Moving request to V2.
#2
+1.
I'm gonna need this ^^
#3
Frankcarey, could you link to the April patch that needs testing, if it still needs testing, or are userpoints now ready to go?
Thanks
Stuart
#4
frankcarey, that's a patch from April of 2009?! Does that even apply to the D7 version?
Any other way to get the userpoints imported?
thanks
UWE
#5
And there is no any chance to get this working?
#6
I ended up writing a custom script that would used the userpoints_userpointsapi() function to "import" the points.
#7
mototribe, can you share?
#8
<?php
//retrieve points from your import table
$result = mysql_query("SELECT uid, points FROM ...", $con);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
//loop over the results
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
$uid = $row['uid'];
$points = $row['points'];
$params = array (
'uid' => $uid,
'points' => $points,
'description' => '....'
);
$ret = userpoints_userpointsapi($params);
}
?>
#9
Please, somebody to help me.
I whant to migrate XML content to custom nodes. It's ok. The question is how to get the id whitch is an atribute.
xml: (i put () instad of angle brackets)
(main)
(aaa id='1')
(bbb)...(/bbb)
(ccc)...(/ccc)
(/aaa)
(/main)
what about:
$item_xpath = '/main/aaa';
$item_ID_xpath = '@id ';
$items_class = new MigrateItemsXML($items_url, $item_xpath, $item_ID_xpath);
also:
$this->map = new MigrateSQLMap($this->machineName,
array(
'id' => array( //****WHAT TO DO WITH THE ID
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
)
),
MigrateDestinationRole::getKeySchema()
);
HEEEELP!
#10
Migration support for a contrib module would best go into that module.
#11
I needed migration support for a project of mine, so I wrote a patch implementing basic migration for Userpoints 1.0
Patch attached ;)
#12
Thanks, looks good, can you improve these comments a bit and then I'm happy to commit this.
+++ b/userpoints.migrate.incundefined@@ -0,0 +1,145 @@
+ public function __toString() {
+ return t('userpoints');
I'm not exactly sure where this is displayed, be we usually use 'User Points' in user facing strings.
Also, this and the one below should have a simple docblock. According to the current coding standards, that would be Overrides/Implements Class/Interface::method().
+++ b/userpoints.migrate.incundefined@@ -0,0 +1,145 @@
+ * Importing given item as userpoints transaction.
+ *
+ * @param stdClass $entity
+ * @param stdClass $row
+ * @return array|bool
+ */
+ function import(stdClass $entity, stdClass $row) {
I assume this is the implementation of a interface method, then the @params and @return isn't necessary and it should just state Implements ... as described above.
Same for those below.
#13
Any news on this?