Closed (fixed)
Project:
Content locking (anti-concurrent editing)
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jun 2011 at 15:06 UTC
Updated:
27 Jun 2011 at 15:41 UTC
Comments
Comment #1
ohnobinki commentedMay you more clearly describe which particular pages that PHP warning shows up on? Are these only on node-editing pages, the node-viewing pages, for nodes of a specific type or with an unusual content type/input format?
I can make some code conditional whether or not ::$body is present or not, but I'd like to know more about the situation and understand the source of the error. At the line referenced in your warning message, $node is supposedly guaranteed to be a node object (which I assume means it's supposed to have a ::body member). I don't have a good enough understanding of the node module yet to understand why a node might not have a ::body ;-).
Comment #2
Eric Yang commentedThanks for pointing out the 'node without body'.
Now I know the source of error.
It is because on my website with that error, I used a node block as a footer.
And that node type does not have a 'body' field!
In another word, a 'node without body' appear at the bottom of every page.
That's why I get error messages everywhere on my website.
Then I turned off footer, There is no more error message except on the page of that footer node.
In Drupal 7, Every content type has a default body field, but you can delete it.
I think this message should be fixed, because people are creating content types without body field.
e.g. A content type of image which only contains a title, an image and a text field of description used for banners.
It is a wonderful module, and on my website, users usually spend hours editing one node. It's good to have a module to lock the content.
Comment #3
Eric Yang commentedComment #4
Eric Yang commentedI reintalled the dev release (2011-06-09) yesterday.
I also found another issue.
If a node with a undefined body (empty body), this message will appear on the node page:
Notice: Undefined index: und in content_lock_content_lock_node_lockable() (line 697 of /var/www/sites/all/modules/content_lock/content_lock.module).
Comment #5
ohnobinki commentedThanks for the explanations and additional note. For now I think I'll just disabled the "input format type" checks when the node doesn't have ::body set. The dev release doesn't yet have that fix, but I just committed what I hope is a quick fix for this at 15a2111.
Comment #6
Eric Yang commentedThank you. It works perfectly now.