I've copied the node_example.module and attempted to mutate it into my evil ways.
So far, everything is good except for I can not get it to auto-publish.
I've been to content and told it to automagically publish them and even when creating a new article (of this new node type) it doesn't publish it to front page (even though the publish checkbox is checked).
I can goto content and force it to be published but that's not the ideal way I want it.
I don't even have any idea where to start looking for this issue.
Is it possible I'm not passing the data it wants and so it doesn't publish it?
I do handle my $node-body a little differently (actually, nothing exists until the hook_validate function;becuase I'm using other fields and just want to mesh those fields into one in a nice orderly way)
Any thoughts?

Comments

nazadus’s picture

I shoud note that by looking at the promote bit in my MySQL table, it *does* show the promote as being 1, but it's still not displaying on front page and content tells me it's unpublished.

-----------------
"Our greatest glory is not in never failing but in rising every time we fall." -- Confusious

nazadus’s picture

For those intersted:
Here is what I did to my node->body and a note that my validate isn't working correctly for some reason...

function kbarticle_validate(&$node) {
  if ($node->summary) {
    // This next line doesn't show after a preview... why?
    form_set_error('summary', t('You must enter a summary.'));
    if ($node->summary == '') {
      form_set_error('summary', t('You must enter a summary.'));
    }
  }


  // Becuase we *have* to have a body and teaser for some modules,
  // let's make them happy too
  $kb_body = theme('kb_article_body', $node);
  $kb_teaser = theme('kb_article_teaser', $node);
  $node->body = $kb_body;
  $node->teaser = $kb_teaser;

}
nevets’s picture

It would appear that $node->summary is not defined or it is empty.
The function kbarticle_form() should be outputting a input field with the name/id of summary. If you looked at the generate source, the field should show a name of edit[summary] and an id of edit-summary.

Note when adding a node of this type kbarticle_validate will be called before displaying the form. In this case even if $node->summary is defined the if will fail since the field is initially empty.

nazadus’s picture

Here is the summary in the form:

$output .= form_textarea(t('Summary'), 'summary', $node->summary, 60, 6, t('A summary is used for the intro. Used for both a <b>Bug Report</b> and
a <b>How To</b>.'),NULL,TRUE);

I've also tried completly removing summary (just in case), but that didnt' solve my publishing problem.

I've also taken some screen shots:
Scrot 01
Scrot 02
Scrot 03
Scrot 04

-----------------
"Our greatest glory is not in never failing but in rising every time we fall." -- Confusious

nazadus’s picture

After looking through node.module, I see that for a module to appear on the front page it must also have status=1. My articles do not have this bit on. when I update/create it is set to 0.
For some reason, I'm not capable of setting that somehow (in code)... hmmm.
I'm lost here other than forcing it... but that just doesn't seem right.

for some reason I feel like I'm diong something stupid.

-----------------
"Our greatest glory is not in never failing but in rising every time we fall." -- Confusious

nazadus’s picture

HAHA ,I found my problem.
I have a $node->status (combo box) AND the status for publishing... crap-doodle.

Thanks!

-----------------
"Our greatest glory is not in never failing but in rising every time we fall." -- Confusious