converting module from d6 to d7: defining content type

I'm working on converting my d6 module to work for d7 and I could use some guidance. The code below is from the d6 module version. Now, in d7, I get a undeclared function error on the node_prepare() call. Taking it out resolves the error but then my content type doesn't have the additional fields $content_type, $amount_of_time, $unit_of_time based on errors I get when viewing instances of the type.

I'm assuming I'm missing a change in the documentation (http://drupal.org/update/modules/6/7) but if someone could point me in the right direction, I'd appreciate it.

/**
 * implementation of hook_view()
 */
function post_reminder_view($node, $teaser = FALSE, $page = FALSE) {
  $node = node_prepare($node, $teaser);
  
  $content_type = node_type_get_type(check_plain($node->content_type));  //display human_readable name, not internal name
  $amount_of_time = check_plain($node->amount_of_time);
  $unit_of_time = check_plain($node->unit_of_time);
  $active = check_plain($node->active);

  $node->content['post_reminder'] = array(
    '#value' => theme('post_reminder_info', $content_type, $amount_of_time, $unit_of_time, $active),
    '#weight' => 1,
  );
  return $node;
}

Errors when editing/creating type:

Upgrading from 6 to 7, or worth the wait?

We're hoping to get our IT company start working on a site within weeks from now. It will be a social network combined with a big editorial content part, and we're expecting to reach >10K members. To what extent will it be 'problematic' to let them start working on a site in 6 and then upgrade to 7? Would 7 be worth waiting a few months?

Thx!

User defined roles in Google Analytics

Hi all,

I've added the GA module to my Drupal installation and would like to track user roles and their behaviour on my site.

The module says "Add tracking only for the selected role(s). If none of the roles are selected, all users will be tracked. If a user has any of the roles checked, that user will be tracked."

Drupal 7 box content

Hi there!
I'm new to Drupal, but now I'm trying to create a theme. I'm done with the design made in pure HTMl/CSS, and I've applied the code to the page.tpl. Everything's working this far. But the design contains a couple of "boxes", and I would like to find a way to make the box content editable in the administration panel. A separate text to edit for each box. Since I'm new to this, I don't know how to do. The "print render($page['content']);" isn't a correct way, right?

Thanks.

Text editors for drupal 7. Not work?

Hi all!!!
I have a problem with text editor for drupal 7. I can't find text editors for this version. Besides wysiwyg editor http://drupal.org/project/wysiwyg, but this editor doesn't work correctly.
What editor you recommend for drupal 7
Thanks in advance!

Edited by WorldFallz - moved to appropriate forum.

Drupal 7 / Ajax / Form submit

I have been trying to make a form that changes the number of textfields present depending on the value of a selectbox. I have been able to update the form, and get the right number of textfields.

The problem is that everytime I change the selectbox the form gets validated/submitted and values inserted into db. This is not what I wanted, anyone know how to get around this?

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x