简体   繁体   中英

Drupal 7 - fatal error with devel themer plugin with custom module

I just installed a famous Drupal module called devel themer. It works with admin and other core pages such as node. The problem is I get a fatal error with my module.

Error Message: Fatal error: Cannot unset string offsets in /home/dev-bioshock/public_html/sites/all/modules/devel_themer/devel_themer.module on line 293

My template.php

function bioshock_theme($existing, $type, $theme, $path) {

    return array(
        'moon_display'=>array(
            'template'=>'moon'

        ),

    );

}

My module.module

function moon_perm() {
  return array('access apps content');
}

function moon_menu() {

      $items['moon'] = array(
      'title' => 'this is a test',
      'description' => t('Detalle de un Programa'),
      'page callback' => 'moon_page',
      'access arguments' => array('access content'),
      'type' => MENU_CALLBACK
  );

  return $items;
}

function moon_page(){

    $moonsvariable = 'hi this is a function';
    return theme('moon_display',$moonsvariable);

}

Do I have an error within my code?

The second argument to theme() must be an array. See for example http://drupal.org/node/933976 . See also Drupal 7 - How to assign a variable to a template?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM