I got this error:
Notice: Undefined property: stdClass::$has_body in stormorganization_form() (line 406 of E:\wamp\www\sites\all\modules\storm\stormorganization\stormorganization.module).

Comments

DaGenius’s picture

I would appreciate if someone can help with this issue. Thanks

KarlisK’s picture

Took Screenshot of errors caught in the logs of my Test enviroment of Drupal.

KarlisK’s picture

StatusFileSize
new107.89 KB
juliangb’s picture

Issues such as these are expected in an early development version, and is actually quite minor compared to the point that the body field doesn't show up at all. They will be fixed as the port progresses.

Chekhov’s picture

I was looking into the issue and there is in fact no information on whether the stormorganization node type should have a body or not. E.g. something like has_body => TRUE in hook_node_info().
Should it be there, or not?
A body_label => t("Note") is there, so I assume the answer is 'yes'. Just to be sure...

juliangb’s picture

Category: support » task

Moving to task, will leave issue open until fixed.

juliangb’s picture

The way we'll need to fix the body with Drupal 7 is to declare as a field:

This is how the core blog module does it.

function blog_install() {
  // Ensure the blog node type is available.
  node_types_rebuild();
  $types = node_type_get_types();
  node_add_body_field($types['blog']);
}

Then, when we view, we'll have to check whether it exists or has been deleted by the user.

esoteric1’s picture

Assigned: Unassigned » esoteric1
esoteric1’s picture

Assigned: esoteric1 » Unassigned
Status: Active » Needs review
StatusFileSize
new1.45 KB

This is my first patch ever.

I added the body field after doing that noticed the comments were enabled. I disabled them and author information programmatically. When the body field is deleted in the manage fields, it does not show up in the add organization form.

esoteric1’s picture

Also, should all of those node attributes be fields?

Status: Needs review » Needs work

The last submitted patch, storm-1477284-addedbodyfield-comment9.patch, failed testing.

esoteric1’s picture

Status: Needs work » Needs review
StatusFileSize
new1.45 KB

Fixed a typo

juliangb’s picture

Status: Needs review » Needs work

Marc-Andre: Thanks for getting involved - excited that you've made your first patch here for Storm!

A couple of comments:
1) We shouldn't turn off comments or hide the submitted by - because the Drupal 6 version doesn't. At this stage I'm not advocating one way or the other, but with the port as much as possible are trying to make it work, rather than make changes.

2) To better help users who are upgrading a previous version, we should also add the body field as part of an update function.

More minor points - if you can, please try to use the Drupal way of formatting code - http://drupal.org/coding-standards - small points such as spaces each side of = signs, but it means that it is a lot more readable.

esoteric1’s picture

okay I will fix all those things and resubmit. Also, are all of the 'attributes' to become fields?

juliangb’s picture

Attributes -> Fields is optional - we don't need it as part of the port, but it is a change that will happen at some point.

My personal preference is to not to it now, but to focus on getting everything working, then do this as a follow up.

esoteric1’s picture

Status: Needs review » Needs work
StatusFileSize
new1.32 KB

I am not sure how to do the update function part but I made the other changes.

esoteric1’s picture

Status: Needs work » Needs review
esoteric1’s picture

Status: Needs work » Needs review

I think I missed a lot of things when i did that patch, i would disregard it for now.

esoteric1’s picture

StatusFileSize
new2.62 KB

Here is another stab at it. I didn't touch the update part though. edited the stormorganization.theme.inc file to be able to display the body if the body was indeed part of the fields.

juliangb’s picture

Status: Needs review » Needs work
+++ b/stormorganization/stormorganization.install
@@ -5,6 +5,16 @@
+  //Hide comments.
+  variable_set('comment_stormorganiation','COMMENT_NODE_HIDDEN');
+  //Hide authoring information
+  variable_set('node_submitted_stormorganization',FALSE);

Looks like we're still disabling comments and hiding the author info.

esoteric1’s picture

jesus, sorry, getting used to git. At the very least I hope this patch doesn't have the same problems.

:(

esoteric1’s picture

Status: Needs work » Needs review
juliangb’s picture

StatusFileSize
new2.96 KB

Thanks for this - pretty much what we need.

In the attached, I've added the update function (so that existing users will also get a body field), and renamed it as a Note in the field system.

juliangb’s picture

StatusFileSize
new3.03 KB

This patch adds a description for the change which is shown on update.php

juliangb’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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