On the odd occasion that the taxonomy module has been disabled in Drupal, an error occurs in userpoints_get_vid() because taxonomy_save_vocabulary($vocab) has not been declared and thus triggers a fatal error.

This patch would resolve this (admittedly) minor issue:

Index: sites/all/modules/userpoints/userpoints.module
===================================================================
--- sites/all/modules/userpoints/userpoints.module (Revision 1574)
+++ sites/all/modules/userpoints/userpoints.module (Arbeitskopie)
@@ -1669,6 +1669,9 @@ function userpoints_my_userpoints() {
* if no vocab exists it will create one
*/
function userpoints_get_vid() {
+ if (!module_exists('taxonomy')) {
+ return false;
+ }
//code lovingly inspired by the image.module w/ code by drewish
$vid = variable_get(USERPOINTS_CATEGORY_DEFAULT_VID, '');
if (empty($vid) || !taxonomy_get_vocabulary($vid)) {

please also find attach

Comments

berdir’s picture

Status: Needs review » Closed (won't fix)

Sorry for spamming the participants in this issue. Due to the release of Drupal 7 and the lack of time from the maintainers, I'm closing all remaining 5.x issues for Userpoints.

Feel free to re-open this issue or create a new one for 6.x or even better 7.x if this bug is still open or feature is missing for these versions.

arithmetric’s picture

Version: 5.x-3.7 » 7.x-1.x-dev
Component: Other » Code: userpoints
Priority: Minor » Major
Status: Closed (won't fix) » Needs review
StatusFileSize
new3.87 KB

Parts of the userpoints module for Drupal 7 still cause a fatal error when the taxonomy module is not enabled. For example, this happens on the "Users by points" (/userpoints) and admin points (/admin/config/people/userpoints) pages.

Attached is a patch that adds a few missing checks for the taxonomy module before queries that reference taxonomy tables or code that uses functions from the taxonomy module. This resolves the errors I've seen that relate to the taxonomy module being disabled.

Status: Needs review » Needs work

The last submitted patch, userpoints-373374-2-error_without_taxonomy.patch, failed testing.

arithmetric’s picture

Status: Needs work » Needs review
StatusFileSize
new3.88 KB

Thanks testbot!

berdir’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

Thanks, commited.

Back to 6.x-1.x.

berdir’s picture

Status: Needs review » Patch (to be ported)
manuel.adan’s picture

Issue summary: View changes
Status: Patch (to be ported) » Closed (outdated)

Closing this as outdated, 6.x version is no longer maintained.