Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8029759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:32:01+00:00 2026-06-05T00:32:01+00:00

This is my first module. I have been trying to successfully install my module

  • 0

This is my first module. I have been trying to successfully install my module since a week now.

I have gone through every line. Even the schema is being installed and entry is made at system table. But still after enabling the module It shows 500 Internal Server Error until I delete the entry from system table.

Please guide me what I am doing wrong.

Note: sisattribute table is already created in drupal database

My .install file

<?php

/**
* @file
*/

function sisinstitute_install() {
 drupal_install_schema('sisinstitute');
 variable_set('node_options_sisinstitute', array('status'));

 $attributes = array();

 $attributes['Country'] = array(
  'US' => 'United States of America',
  'AD' => 'Andorra',
  'AE' => 'United Arab Emirates',
  'AF' => 'Afghanistan',
 );

$s = "INSERT INTO {sisattribute} (domain, akey, avalue, weight) VALUES ('%s', '%s', '%s', %d)";
$prevdomain = '';
$weight = 0;
foreach ($attributes as $domain => $attribute) {
if ($domain != $prevdomain) $weight=0;
foreach ($attribute as $key => $value) {
  db_query($s, $domain, $key, $value, $weight);
  $weight++;
}
$prevdomain = $domain;
}
}

function sisinstitute_disable() {
drupal_set_message(t('Please note that they will now have reduced functionality, and will not be protected by previous access controls.'), 'warning');
}

function sisinstitute_uninstall() {
 drupal_uninstall_schema('sisinstitute');

db_query($s = "DELETE FROM {sisattribute} WHERE domain IN ('Country')");
}

function sisinstitute_schema() {
  $schema['sisinstitute'] = array(
   'fields'        => array(
    'vid'         => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
    'nid'         => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
    'country'     => array('type' => 'varchar', 'length' => 100),
    'www'         => array('type' => 'varchar', 'length' => 100),
    'phone'       => array('type' => 'varchar', 'length' => 100),
    'email'       => array('type' => 'varchar', 'length' => 50),
    'provstate'   => array('type' => 'varchar', 'length' => 50),
    'zip'         => array('type' => 'varchar', 'length' => 10),
    'city'        => array('type' => 'varchar', 'length' => 100),
    'address'     => array('type' => 'varchar', 'length' => 100),
    'orglanguage' => array('type' => 'varchar', 'length' => 100),
    'isactive'    => array('type' => 'int', 'default' => 1),

  ),
  'primary key' => array('vid'),
  'indexes' => array(
  'nid'     => array('nid')
  ),
  );

  return $schema; 
  }

And my .module file:

<?php
// $Id$

/**
*@File
*Module for Institution support in SIS package
*/


/**
*hook_help()
*/


/**
*hook_menu()
*/




/**
*hook_perm()
*/
function sisinstitute_perm() {
  return array('access institute', 'create institute', 'edit institute', 'delete institute', 'view belonged institute', 'view all institutes');

}






/**
*hook_access()
*/
function sisinstitute_access($op, $node. $account=NULL) {
 if (empty($account)) {
  global $user;
  $account = $user;
 }

 if (is_numeric($node)) $node = node_load($node);

 if (!isset($account->sisinstitute_nid) && module_exists('sisstudent')) {
  _sisstudent_load($account);
 }

 if (!isset($account->sisinstitute_nid) && module_exists('sisstaff')) {
  _sisstaff_load($account);
 }

 switch($op) {
  case 'create': return user_access('create institute', $account);
  case 'update': return user_access('edit institute', $account);
  case 'delete': return user_access('delete institute', $account);
  case 'view'  : {
                  if (user_access('view all institutes', $account))
                    return TRUE;
                  elseif (user_access('view belonged institute', $account) && $account->sisinstitute_nid == $node->nid)
                    return TRUE;
                  else return FALSE;
                 }
 }
}




/**
*hook_node_info()
*/

function sisinstitute_node_info() {
 return array(
  'sisinstitute' => array(
  'name' => t('Institute'),
  'module' => 'sisinstitute',
  'description' => t("Institute for SIS"),
  'title_label' => t("Name"),
  'body_label' => t("Note"),
)
);

}



/**
*hook_form()
*/
function sisinstitute_form(&$node) {
 $type = node_get_types('type', $node);

 //$form['#attributes']['class'] = 'sismcomponent_node_form';

 $form['title'] = array(
  '#type' => 'textfield',
  '#title' => check_plain($type->title_label),
  '#required' => TRUE,
  '#default_value' => $node->title,
  // '#weight' => module_exists('content') ? content_extra_field_weight($node->type, 'title') : -18,
  );


$form['isactive'] = array(
 '#type' => 'checkbox',
 '#title' => t('Active'),
 '#default_value' => $node->isactive,
);

return $form;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:32:02+00:00Added an answer on June 5, 2026 at 12:32 am

    Hmm Got it:-)(after 8 hours)

    function sisinstitute_access($op, $node. $account=NULL) {

    has a period instead of a comma after $node

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a custom module using Magento's EAV structure and have been
I have been trying to connect sphinx server with nodejs and limestone module. But
I have been looking through this fantastic article: http://blogs.zynaptiq.com/bernsee/pitch-shifting-using-the-ft/ While being fantastic, it is
I have been trying to learn Python for a while now. By chance, I
First question ever on stackoverflow. Been reading for some time now, while trying to
I have a problem I've been struggeling with for a full week now, and
i have two arrays like this first array Array ( [0228] => Array (
Using Dozer to map two objects, I have: /** /* This first class uses
I have a JSON data like this: { hello: { first:firstvalue, second:secondvalue }, hello2:
I'm stuck on this and have been all day.. I'm still pretty new to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.