Hi,

I found some sub-module of userpoints_contrib haven't port to d7 version. Anyone can help?
At present, userpoints_retroactive is one of the more important, so please help port this one first.
Thanks!

Comments

alfababy’s picture

StatusFileSize
new4.26 KB

Hi jackniu,

I attached a quick doing the patch, maybe it has bug.
Please test it.

Feel free to let me know if you would have any questions, comments or issues about this ticket in general, I would be glad to answer and provide more details.
Thanks very much in advance.

Cheers!

dydave’s picture

Status: Active » Needs review

Changing issue status to needs review for automated testing of patch.

Any feedback, testing, reporting and reviews would be highly appreciated.
Thanks to all in advance!

berdir’s picture

+++ b/userpoints_retroactive/userpoints_retroactive.moduleundefined
@@ -2,37 +2,36 @@
 function userpoints_retroactive_menu() {
-  $items['admin/settings/userpoints/retroactive'] = array(
-    'page callback'    => 'userpoints_retroactive_page',
+  $items['admin/config/people/userpoints/retroactive'] = array(
     'title'            => t('Retroactive'),
-    'access arguments' => array(USERPOINTS_PERM_RETROACTIVE),
-    'type'             => MENU_NORMAL_ITEM
+    'page callback'    => 'drupal_get_form',
+    'page arguments'   => array('userpoints_retroactive_form'),
+    'access arguments' => array('retroactive userpoints'),
+    'type'             => MENU_LOCAL_TASK,

You can alternatively also form alter the settings into the vertical tabs so that all settings are in one place.

The way the userpoints are added most likely also needs some updates to be compatible with the new operations defined in userpoints_nc now so that they show up the same as as newly granted points.

dydave’s picture

Thanks very much @Berdir for your feedback and advice on that.

We're surely going to look closer at your comments and get back to this issue with an updated patch.

Additionally, I wanted to add that we should probably also try adding a simpletest file, for automated testing (provided in API since D7).
We could probably add a new file called userpoints_retroactive.test as well, along with the port.

We would greatly appreciate to have any further questions, comments, opinions, suggestions or feedback.

Thanks very much to all in advance for your help, testing, reporting or comments.
Cheers!

jackniu’s picture

alfababy’s picture

StatusFileSize
new9.03 KB

New patch is coming.

It need depend User points Nodes and Comments module.
It will load userpoints_nc's settings automatic for granting the point, and you can choose whether enable to retrocactive node and comment.

Cheers.

berdir’s picture

Status: Needs review » Needs work
+++ b/userpoints_retroactive/userpoints_retroactive.moduleundefined
@@ -2,42 +2,71 @@
+    '#markup' => theme('table', array('rows'=>$node_type_info, 'header'=>array('Type', 'Points', 'Category', 'Comment points', 'Comment category'))),
+    '#prefix' => '<div>Below the settings info from <b>User points Nodes and Comments</b> module.</div>',

Needs to use t() around translatable strings (prefix, table headers), spaces around => and should use instead of .

+++ b/userpoints_retroactive/userpoints_retroactive.moduleundefined
@@ -72,16 +123,26 @@ function userpoints_retroactive_do() {
-function userpoints_retroactive_nodes() {
+function userpoints_retroactive_nodes($node_type_point_info) {

@@ -92,16 +153,31 @@ function userpoints_retroactive_nodes() {
-function userpoints_retroactive_comments() {
+function userpoints_retroactive_comments($node_type_point_info) {

These functions will not scale if you have many nodes/comments. We should use the batch API to make sure that we can process an unlimited amount of points. See http://drupal.org/node/180528

+++ b/userpoints_retroactive/userpoints_retroactive.moduleundefined
@@ -72,16 +123,26 @@ function userpoints_retroactive_do() {
       'operation' => t('Retroactive node'),

@@ -92,16 +153,31 @@ function userpoints_retroactive_nodes() {
       'operation' => t('Retroactive comment'),

This should use the matching operation defined in userpoints_nc_userpoints_operation_info().

alfababy’s picture

Hi berdir,

Thanks for your suggestion.
I will fix them soon, and change it to use Batch API.

Starminder’s picture

I'd like to get userpoints up and running again on my site, this module is the showstopper. Any plans to finish it?

fugazi’s picture

same question would be happy even if it works for D7

darrellhq’s picture

Issue summary: View changes

Will there be any update for this module?