summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShabanaBlackborder2013-09-04 14:07:37 (GMT)
committer ShabanaBlackborder2013-09-04 14:07:37 (GMT)
commit78e8a479716b4b25fdbb693ca952a37f7a849df8 (patch)
tree4c62036cdce85fadd6b2deec7ce49fcc6d490f73
parentea66ba5f81ee97f0341c2118499efb72b029be0f (diff)
Issue #2027873 by Shabana Blackborder: Fixed 1 is not a valid badge ID. Try using the autocomplete function (requires javascript).
-rw-r--r--user_badges.admin.inc2
-rw-r--r--user_badges.module4
2 files changed, 3 insertions, 3 deletions
diff --git a/user_badges.admin.inc b/user_badges.admin.inc
index cdaf76a..160f482 100644
--- a/user_badges.admin.inc
+++ b/user_badges.admin.inc
@@ -730,7 +730,7 @@ function user_badges_roles_form_submit($form, &$form_state) {
$array = $form_state['values']['roles'] + $form_state['values']['blocked'];
foreach ($array as $field => &$value) {
// We now have a string as our badge, so just extract the bid.
- preg_match('/\(' . t('Badge ID') . ' (\d+)\)/', $value, $matches);
+ preg_match('/\(' . 'Badge ID' . ' (\d+)\)/', $value, $matches);
// Transform our value into just the bid.
if (!empty($matches)) {
$value = $matches[1];
diff --git a/user_badges.module b/user_badges.module
index 53f6f2c..3e8277d 100644
--- a/user_badges.module
+++ b/user_badges.module
@@ -513,7 +513,7 @@ function user_badges_badge_autocomplete($string = '') {
->execute();
foreach ($result as $badge) {
- $matches[$badge->name . ' (' . t('Badge ID') . ' ' . $badge->bid . ')'] =
+ $matches[$badge->name . ' (' . 'Badge ID' . ' ' . $badge->bid . ')'] =
check_plain($badge->name) . ' ' . theme('user_badge', array('badge' => $badge));
}
}
@@ -537,7 +537,7 @@ function user_badges_badge_autocomplete($string = '') {
* 'nobid' for a correctly formatted string with an invalid badge ID
*/
function user_badges_badge_autocomplete_validation($value) {
- if (preg_match('/\(' . t('Badge ID') . ' (\d+)\)/', $value, $matches)) {
+ if (preg_match('/\(' . 'Badge ID' . ' (\d+)\)/', $value, $matches)) {
//The format was correct, but we need to check the bid exists
$bid = $matches[1];
$records = db_select('user_badges_badges', 'ubb')