Critical Menu Entry Bug "Give Points"

slinc - November 18, 2008 - 07:17
Project:User Points Contributed modules
Version:5.x-3.0
Component:Code: user2userpoints
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi there,

When enabling the user2userpoints component, an uneditable entry on the navigational menu named "Give Points" is created.

The problem is that it is IMPOSSIBLE to remove or relocate this entry, because when "Administer > Menus" (or admin/build/menu) is accessed, the "Give Points" entry disappears on the menu, and therefore is not shown in the menu administration page.

Additionally, ALL roles (including anonymous) are able to view this faulty entry.

In order to reproduce this problem, enable the user2userpoints component, and try to remove or relocate the "Give Points" entry on the navigation menu.

Thanks for your help!

#1

kbahey - November 18, 2008 - 15:50
Priority:critical» normal

In user2userpoints.module edit this:

<?php
    $items
[] = array(
     
'path'               => 'user2userpoints',
     
'title'              => t('Give !points', userpoints_translation()),
     
'callback'           => 'drupal_get_form',
     
'callback arguments' => array('user2userpoints_giveform'),
     
'access'             => array(USER2USERPOINTS_PERM_SEND),
    );
?>

To this:

<?php
    $items
[] = array(
     
'path'               => 'user2userpoints',
     
'title'              => t('Give !points', userpoints_translation()),
     
'callback'           => 'drupal_get_form',
     
'callback arguments' => array('user2userpoints_giveform'),
     
'access'             => array(USER2USERPOINTS_PERM_SEND),
     
'type'    => MENU_SUGGESTED_ITEM,
    );
?>

See if this fixes it.

#2

kbahey - November 18, 2008 - 15:50
Status:active» postponed (maintainer needs more info)

#3

slinc - November 19, 2008 - 10:12
Status:postponed (maintainer needs more info)» fixed

Hi there,

Thanks for your quick reply.

Your suggested modification fixes this problem, as the unwanted entry is removed.

In order to edit it though, I needed to manually create a new menu link that linked to "user2userpoints", and place it on a menu.

However, your fix works perfectly for my purposes.

Thanks for your help!

#4

System Message - December 3, 2008 - 10:12
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#5

jandoemen - February 1, 2009 - 13:03
Status:closed» active

Could the menu problem be implemented so that it is e regular menu item that is there from the beginning so that you just can say who may have access?

Maybe an entry in the access control would be nice too.

Greetz
Jan

 
 

Drupal is a registered trademark of Dries Buytaert.