userpoints_expire.module uses an array containing the key 'event' to call userpoints_userpointsapi(), which is documented to accept an array with the key 'operation'.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | event-to-operation.patch | 5.33 KB | kbahey |
userpoints_expire.module uses an array containing the key 'event' to call userpoints_userpointsapi(), which is documented to accept an array with the key 'operation'.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | event-to-operation.patch | 5.33 KB | kbahey |
Comments
Comment #1
kbahey commentedActually, the README.txt for the API still documents the name of the parameter as 'event', although the database column is called 'operation'.
So the module is doing the right thing.
However, for consistency, we may want to rename the parameter event to operation in a future API overhaul.
Thus moving to Userpoints API project.
Comment #2
kbahey commentedChanging the title to be more descriptive.
Comment #3
avpadernoThat is not exact. It's
userpoints_expire.modulewhich uses the wrong parameter.Comment #4
avpadernoThe problem is not with
userpoints_userpointsapi(), but with the modules which use it.They use
$params['event']when they should use$params['operation'].Comment #5
avpadernoComment #6
kbahey commentedKiam
Did you read the README.txt document before changing the issue back?
Go and read here under "API".
It says:
'event' => (string) varchar32 descriptive identifier administrative purposesSo, the parameter name is still event, not operation. This is why it needs to change in Userpoints API, before the other modules can be changed.
Comment #7
avpadernoI think we are talking of two different things.
If the README.txt is not updated, that is one issue; the issue I am talking of is that the modules don't use the correct parameter (or the parameter with the correct name, if you prefer).
If the README.txt isn't updated, the inline documentation is updated, or I would not have known which parameters
userpoints_usperpointsapi()requires.Comment #8
kbahey commentedI think we are both right, and both wrong too.
userpoints_userpointapi() has this:
And the code has 'operation' everywhere.
However, there is just one place that still has 'event', here:
I am attaching a patch for 5.x-3.x that would make it all "operation" instead of the old "event".
If you and jredding can review this patch and see if it does not break anything, then I will commit it, then I will do a wholesale change for the userpoints_contrib as well, with one issue (since the change is the same for all modules).
We also need to port this patch to 6.x later.
Comment #9
kbahey commentedThe parallel issue for userpoints_contrib is here http://drupal.org/node/265764
Review of both patches needed.
Comment #10
avpadernoComment #11
kbahey commented@jredding
Can you eye over this one please?
Comment #12
jredding commentedThe hook should've also been called operation and not event and an eyeball over the patch looks OK.
The change doesn't affect any existing code so I suggest we put it straight into 5.3.6 and roll a new release.
Comment #13
kbahey commented