Download & Extend

hidden_hide_submit() doesn't use t() for $op values

Project:Hidden
Version:5.x-2.2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

When user will translate button default names from "Hide" and "Report"
to their own language, it will NOT work at all, see below what should be changed,
I believe it is too simple mistake/typo to submit patch.

function hidden_hide_submit($form_id, $form_values) {
  $op = (string)$form_values['op'];
  //if ($op == 'Hide') {
  if ($op == t('Hide')) {
    if (! user_access('mark as hidden')) {
      drupal_access_denied();
    }
  }
  //elseif ($op == 'Report') {
  elseif ($op == t('Report')) {
    if (! user_access('report for hiding')) {
      drupal_access_denied();
    }
  }

HTH
Bartek

Comments

#1

You need also to change it again in the same function (line 1857):

  if ($op == t('Hide')) {
    if (_hidden_hidden_hide($nid, $cid, $uid, $rid, $public, $private)) {
      $msg = t('Hidden %type.', $t_args);
      _hidden_log(HIDDEN_LOG_HIDE, $msg, $type, $id, $rid, $public, $private);
      drupal_set_message($msg);
    }

L.M.

#2

Status:active» fixed

Cheers, committed these so they're in CVS and checked this is the only place $op contains $form_values.

#3

Status:fixed» closed (fixed)

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

nobody click here