If there are submenu the main menu link should be disabled.

Files: 

Comments

chandan.drupalchamp’s picture

jQuery(document).ready(function(){

jQuery("#superfish-1 li:has(ul)").hover(function(){
jQuery(this).children("a").click(function(){
return false;
});
});

});

chandan.drupalchamp’s picture

Title:Disable the parent link but not submenus in drupal 7» Notice: Undefined property: stdClass::$nid in auto_nodetitle_set_title()
Project:Nice Menus» Automatic Nodetitles
Version:7.x-2.0» 7.x-1.x-dev
Assigned:Unassigned» chandan.drupalchamp

Notice: Undefined property: stdClass::$nid in auto_nodetitle_set_title() (line 81 of C:\xampp\htdocs\coffee\sites\all\modules\auto_nodetitle\auto_nodetitle.module).

function auto_nodetitle_set_title(&$node) {
$types = node_type_get_types();
$pattern = variable_get('ant_pattern_' . $node->type, '');
if (trim($pattern)) {
$node->changed = REQUEST_TIME;
$node->title = _auto_nodetitle_patternprocessor($pattern, $node);
}
--elseif ($node->nid)
++elseif (!empty($node->nid))//Changed code is
{
$node->title = t('@type @node-id', array('@type' => $types[$node->type]->name, '@node-id' => $node->nid));
}
else {
$node->title = t('@type', array('@type' => $types[$node->type]->name));
}

deepakchaudhary’s picture

I also have the same issue.

Notice: Undefined property: stdClass::$nid in ex_contents() (line 30 of C:\wamp\www\drupal-7.14\sites\default\modules\a\a.module).
Notice: Undefined property: stdClass::$nid in ex_contents() (line 30 of C:\wamp\www\drupal-7.14\sites\default\modules\a\a.module).
Notice: Undefined property: stdClass::$nid in ex_contents() (line 30 of C:\wamp\www\drupal-7.14\sites\default\modules\a\a.module).

function a_block_view($bs_name = '')
{
if($bs_name = 'node')
{
$block = array();
$block['subject'] = t('Recent Articles');
$block['content'] = ex_contents();
}
return $block;
}
function ex_contents()
{
$p = '';
$query = db_select('node', 'n');
$query->condition('n.type', 'article', '=')
->fields('n', array('title'))
->range(0, 50);
$result = $query->execute();
foreach ($result as $node) {
$node->nid;
$rows[] = array('data' => $node, 'class' => array('accessible'));
}
$p .= '<div>' . theme('table', array('rows' => $rows)) . '</div>';
return $p;
}
Angry Dan’s picture

This thread seems to be a bit nuts, but I'm 100% getting that notice in the title. In my case it's caused by creating a node using Rules. When you want to create a new node with rules you must use the "create entity" action which turns out a new node object that (for reasons complicated) doesn't get an nid property until after the save is complete. When ANT runs it's trying to read the nid property and that's producing a notice.

It's a simple fix - line 81, change elseif ($node->nid) { to elseif (!empty($node->nid)) {

randell’s picture

Issue summary:View changes

Solution in #4 worked for me.

Alex Bukach’s picture

Assigned:chandan.drupalchamp» Unassigned
Category:Feature request» Bug report
Status:Active» Needs review
StatusFileSize
new415 bytes

Providing a patch implementing #4.

Alex Bukach’s picture

Status:Needs review» Needs work
Alex Bukach’s picture

Status:Needs work» Needs review
rossb89’s picture

Have just ran into this issue as well, patch in #6 solves the issue and is an appropriate fix.

rossb89’s picture

Status:Needs review» Reviewed & tested by the community