API page: http://api.drupal.org/api/drupal/modules--node--content_types.inc/functi...

> $type (optional) The machine name of the node type when editing an existing node type.

It's obviously not a machine name if you can do this with it:

  if (!isset($type->type)) {
    // This is a new type. Node module managed types are custom and unlocked.
    $type = node_type_set_defaults(array('custom' => 1, 'locked' => 0));
  }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Title: Documentation problem with node_type_form » node_type_form doc for $type isn't correct
Issue tags: +Novice, +Needs backport to D7

Good point. Needs a patch, should be good novice project.

surendramohan’s picture

Assigned: Unassigned » surendramohan

Would come up with the patch for this.

GRO’s picture

I'm a novice and want to help out but need some clarification on where the patch needs to be applied. Is it solely the API documentation that will need to be patched to remove the reference to a machine name and how is that done?

jhodgdon’s picture

This page has a guide:
http://drupal.org/node/144223

xjm’s picture

surendramohan, are you still looking into this issue? If not we'll unassign it in a day or to so that others (like GRO) can work on it. Thanks!

frankbaele’s picture

I want to work on this

jhodgdon’s picture

frankbaele: Please go ahead and assign the issue to yourself, since the other person did not respond since January to an "are you working on this" inquiry. Thanks!

frankbaele’s picture

Assigned: surendramohan » frankbaele
nit3ch’s picture

FileSize
547 bytes

hi ,
Here is the patch.Sorry if i should wait for frankbaele's ptach.
thanks

jhodgdon’s picture

Status: Active » Needs work

RE #9 -
- It would have been slightly more polite to ask frankbaele if he was going to provide a patch, rather than just taking over the issue. And you should assign the issue to yourself if you plan to work on it.
- When attaching a patch, you need to set the status to "needs review", to alert both people and the testing bot that there is a patch to review.
- The patch does not actually fix the problem -- see original issue report. The problem is that $type is not a string at all, it's an object.

nit3ch’s picture

apologize. Will take care of it next time :)

jhodgdon’s picture

ok. So nit3ch are you planning to make a replacement patch that fixes the problems? If so, please assign the issue to yourself and proceed. :)

nit3ch’s picture

Assigned: frankbaele » nit3ch

hi,
ya i will love to fix this .From the above discussion , what i concluded that $type is not a machine name ,its a object , so the possible solution may be .
> $type (optional) The object of the node type when editing an existing node type.

jhodgdon’s picture

How about "An object representing the node type, when editing an existing node type." -- I think that would be a bit clearer.

nit3ch’s picture

Status: Needs work » Needs review
FileSize
559 bytes

yeah sounds good to me too. Here is the patch against it
thanks.

jhodgdon’s picture

Status: Needs review » Needs work

OK, but it needs to have lines that wrap at 80 characters at most (including spaces at the beginning of the line).

nit3ch’s picture

hi,
i countet it using charctercounttool_dot_com , it is 78 char in first line.
please correct me if i am wrong.
thanks

Haza’s picture

This "tool" does not count the white spaces there are at the begging of the line.

nit3ch’s picture

Status: Needs work » Needs review
FileSize
604 bytes

here is the patch with correction.

Haza’s picture

Status: Needs review » Reviewed & tested by the community

Seems now ok for me.

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Committed to 8.x/7.x.

Automatically closed -- issue fixed for 2 weeks with no activity.