This error appears when I access the permisions tab in people, while the drutex module is enabled, if I disable it, then this error disappears. I am also getting in the logs all the notice's about "Notice: Undefined variable: format in drutex_submodule_implements() (line 853 of /var/www/html/noao/sites/all/modules/drutex/drutex.module)."

But I think that that is unrelated.

php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker
php 05/12/2011 - 10:35 Notice: Undefined variable: format in drutex... dwalker

Comments

dwalker51’s picture

I also noticed this similiar problem... http://drupal.org/node/1045358

Where they mention that it could be according to #2 error in one of the modules you have installed -- it isn't implementing hook_permission() correctly..

and here http://drupal.org/node/1017202
or here http://drupal.org/node/1136908

dwalker51’s picture

I see in drutex.module the hook_permission might not be ready...not sure how to proceed, I can deactivate which would be a shame or I can leave the drutex module active, since its working fine but then I can't see my permissions page, which is a pain.

* Implements hook_permission().
*/
function drutex_permission() {
// TODO The array elements in this hook function need to be changed.
return drutex_submodule_invoke_all('perm');
}

I changed in drutex.module to the following and I can now access my permission page and have drutex enabled using what appeared here:
http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...

but I don't think this is a permanent solution.

* Implements hook_permission().
*/
function drutex_permission() {
// TODO The array elements in this hook function need to be changed.
//return drutex_submodule_invoke_all('perm');
return array(
'administer my module' => array(
'title' => t('Administer my module'),
'description' => t('Perform administration tasks for my module.'),
),
);

}

inTOOLS’s picture

Yes, the hook_permission in current dev version is not compatible with D7.

Basically DruTeX has two permissions:

  • access pdf files
  • access latex source

These give for a user role access to the pages

  • drutex/pdf/[nid]
  • drutex/latex/[nid]

where the [nid] argument is the node id of the node with LaTeX source. When you access those URLs you get respectively PDF or LaTeX file prepared from the node source and template from the DruTeX module.

In the current dev version there is a problem with the permissions page, when DruTeX module is enabled because of this fragment (676-682 line of drutex.module file):

/**
 * Implements hook_permission().
 */
function drutex_permission() {
  // TODO The array elements in this hook function need to be changed.
  return drutex_submodule_invoke_all('perm');
}

Now, @dwalker51 correction was in right direction, but you can go further and take a look at hook_menu in the same file (last two items):

/**
 * Implements hook_menu().
 */
function drutex_menu() {
  $items = array();
  if (drutex_submodule_is_active('remote', NULL)) {
    $items['drutex/remote'] = array(
      'title' => 'Drutex Remote Rendering',
      'file' => 'drutex_remote.inc',
      'page callback' => 'drutex_remote_do_render',
      'access callback' => 'user_access',
      'access arguments' => array('access content'),
      'type' => MENU_CALLBACK,
    );

    $items['admin/config/drutex'] = array(
      'title' => 'DruTeX Settings',
      'description' => 'Adjusts the settings for the remote LaTeX rendering interface',
      'file' => 'drutex_remote.inc',
      'page callback' => 'drupal_get_form',
      'page arguments' => array('drutex_remote_admin_settings'),
      'access callback' => 'user_access',
      'access arguments' => array('administer site configuration'),
      'type' => MENU_NORMAL_ITEM,
    );
  }
  if (drutex_submodule_is_active('pdf', NULL)) {
    $items['drutex/pdf'] = array(
      'title' => 'node2pdf',
      'file' => 'drutex_pdf.inc',
      'page callback' => 'drutex_node2pdf_wrapper',
      'page arguments' => array(2),
      'access callback' => 'user_access',
      'access arguments' => array('access pdf files'),
      'type' => MENU_CALLBACK,
    );

    $items['drutex/latex'] = array(
      'title' => 'node2latex',
      'file' => 'drutex_pdf.inc',
      'page callback' => 'drutex_node2latex_wrapper',
      'page arguments' => array(2),
      'access callback' => 'user_access',
      'access arguments' => array('access latex source'),
      'type' => MENU_CALLBACK,
    );
  }

  return $items;
}

to determine, that the permissions should look like below:

/**
 * Implements hook_permission().
 */
function drutex_permission() {
  return array(
  'access pdf files' => array(
  'title' => t('Access PDF files'),
  'description' => t('Access PDF files on drutex/pdf.'),
  ),
  'access latex source' => array(
  'title' => t('Access latex source'),
  'description' => t('Access LaTeX source on drutex/latex.'),
  ),
  );
}

For me it worked when I reinstalled DruTeX module with this corrections. Now I can access my permissions page, and set permissions for DruTeX URLs.

abbasmousavi’s picture

Assigned: Unassigned » abbasmousavi

thanks dwalker51 and intools

yes, the hook_permission is not implemented yet, I will correct this in my next commit.

abbasmousavi’s picture

thanks dwalker51 and intools

yes, the hook_permission is not implemented yet, I will correct this in my next commit.

abbasmousavi’s picture

Status: Active » Closed (fixed)

I have commited the changes. Please check 7.x-1.0-alpha1.