The comments were deleted because a user flagged them, and a second user commented saying they should be removed. The question also received an automatic flag from the system for the number of comments it received.
Keep in mind that:
- Comments aren't meant to evolve into a discussion
- Comments are second class citizens
This means:
- If there is somebody that asks you more information, you should write that information into the question, if it is relevant, or make any difference for who answers. For example, if somebody asks the Drupal version for which you are interested, you should edit the question, and report that; if somebody asks you what, e.g.,
dsm()
returns, you should edit the question to add that information, rather than commenting with that information, as that is probably information that is useful to who answers. Who answers doesn't need to look for important information given in the 11th comment.
- If somebody disagrees with what you are trying to do, and comments saying it, there isn't the need to start a debate about whose opinion is correct.
Looking at the specific case, there are 18 deleted comments; 9 of those comments where written by you, who also wrote the final three comments. Actually, there is a comment after yours, but that is the comment suggesting the comments should be, "cleaned up."
Your last 4 comments were the following ones. (I am writing them from the most recent to the older one.)
Yup, that did it. Thanks. OP updated to show working code.
I tried your drupal_set_message and got what I expected: on an actual session node, it displays a lovely array of the taxonomy term. On the view page, it tells me that 'node' is an undefined index. So maybe the entire thing needs to go inside a test to see if node->type exists.
It does exist when it's actually displaying a content type=session node on the session page template. The problem is when I'm using a page display for a view that contains sessions, it apparently thinks I'm displaying a session node, when I'm really not. What I need is some way to tell the function to run when displaying an individual node, but not a group of nodes in a view.
Not sure what you mean by that. I need to run the code on nodes that ARE content type=session; I just don't want it to display on the view page display that contains content type=session.
For the other comments, there is exactly one comment from a user followed by a comment from you; that at least leads me to think you read all the comments given by the users who replied you.
The rest of the comments are not constructive, in some way, as they don't give useful information to answer the question; they are just being a discussion about what said in a previous comment.
User A: The surrounding if
should take care of what you are trying to accomplish, so I'd check and make sure this is the place you are getting your error message from. That, and you actually have ==
in there, not =
.
You: Uh, it's supposed to be ==
- that is how php checks for equality. Single =
is the assignment operator. And yes, this is the place I'm getting the error message from. It didn't occur until I added this function, and it goes away as soon as I comment it out.
User A: That's what I said. Make sure it's ==
.
You: Sorry, my misunderstanding. You didn't actually say, "make sure", you said "you actually have". It sounded like you were telling me that I had ==
in there, which I obviously do.
User A: Sorry, I said 'make sure' in the previous sentence and continued that thought in my mind into the next. In any case, something is going wrong with your if
logic there as it should only be executing when the node type is "session," so I'd look into what could be causing that. Perhaps drupal_set_message('<pre>' . print_r($vars['node'], TRUE) . '</pre>')
or something similar will shed more light on the situation.
In such cases, comments are deleted (when flagged) exactly for stopping the discussion.
Keep in mind that Stack Exchange sites are not forums.
Stack Exchange sites follow a Q&A format, where comments are not used for discussion, but for short, in-point observations. If anything needs to be preserved, that should be written in an answer, or in the question, considering that a question should not contain its answer, and an answer should not ask for further information about the problem to resolve.