Note that there are some explanatory texts on larger screens.

plurals
  1. POWeird problem with hook_view drupal
    primarykey
    data
    text
    <p>I'm having a weird problem with hook_view. The problem is, hook_view isn't invoked unless hook_load returns invalid value such as empty variable. I don't know what causes this to happen and I'm at my wit's end. I'm very much appreciate your help. For what is worth, I have image attach module installed. </p> <p>Drupal 6.x</p> <p><strong>UPDATE</strong></p> <pre><code>function mymodule_node_info(){ return array( 'nodetype1' =&gt; array( 'name' =&gt; t('nodetype1'), 'module' =&gt; 'mymodule_nodetype1', 'description' =&gt; t('....'), 'has_title' =&gt; TRUE, 'title_label' =&gt; t('Title'), 'has_body' =&gt; TRUE, 'body_label' =&gt; t('Body'), ), 'nodetype2' =&gt; array( ...... 'module' =&gt; 'mymodule_nodetype2', ...... ), 'nodetype3' =&gt; array( ...... 'module' =&gt; 'mymodule_nodetype3', ...... ), 'nodetype4' =&gt; array( ...... 'module' =&gt; 'mymodule_nodetype4', ....... ), ); } function mymodule_nodetype1_load($node){ $query = 'SELECT f1,f2,...,f10 FROM {tb1} INNER JOIN {tb2} ON {tb1}.vid = {tb2}.vid WHERE {tb1}.vid = %d'; $result = db_query($query,$node-&gt;vid); return db_fetch_object($result); } function mymodule_nodetype1_view($node, $teaser = FALSE, $page = FALSE){ $node = node_prepare($node, $teaser); // get it ready for display $f1 = check_markup($node-&gt;f1); .............. $f10 = check_markup($node-&gt;f10); // Add theme stuff here $node-&gt;content['mycontent'] = array( '#value' =&gt; theme('defaultskin', $f1,...,$f10), '#weight' =&gt; 1, ); return $node; } function mymodule_theme(){ return array( 'defaultskin' =&gt; array( 'template' =&gt; 'node-defaultskin', 'arguments' =&gt; array( 'f1' =&gt; NULL, ...... 'f10' =&gt; NULL, ), ), ); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload