broken update function 2 (4.6 migration...)
yched - January 17, 2007 - 15:53
| Project: | Node Moderation |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
nmoderation_update_2 does not respect the format for update function return values
It should return something like
array(
'query' => strtr('Migrated NModeration votes to VotingAPI'),
'success' => TRUE
);Plus in the first line :
$result = db_query_range('SELECT * FROM {nmoderation_uservotes}', 0, $limit);$limit has no value at this time (not sure what it's supposed to be)

#1
Oops - forgot the strtr in code copy / paste.
The return value should be :
array('query' => 'Migrated NModeration votes to VotingAPI',
'success' => TRUE
);
More importantly, the $limit == NULL issue actually stops the update from doing anything.
Removing it (and changing db_query_range to a regular db_query) seems to do the trick.
(the update function might then need to be reworked to account for multistep updating in order to avoid potential php timeout issues for large number of records in nmoderation_uservotes)
Questions :
- it seems nmoderation_uservotes is empty after the update, so it might be dropped ?
- it seems nmoderation_filters is not used anymore, so it might also be dropped ?
#2
updated patch :
NMODERATION_TYPE should be NMODERATION_VOTE_TYPE