This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Node object loses properties after _insert hook?

Greetings!

I have run into a situation where the node object seems to lose its properties when node.module invokes module _insert hooks. Here is a case:

0. some.module is a module that adds a node and a related taxonomy term.
1. User submits new content from some.module
2. some.module processes the user input through _validate, then (assuming valid input) _insert.
3. _insert then saves the taxonomy term a la:

  $edit["name"] = $node->title;
  $edit["vid"] = variable_get("some_vid", 0);
  $edit["synonyms"] = $node->synonyms;
  $edit["description"] = $node->body;
  $edit = taxonomy_save_term($edit);
  $node->taxonomy = array($edit["tid"]);

4. A trace of $node->taxonomy reveals that it is an array containing the desired tid.
5. The node object is then, presumably, passed on to taxonomy.module.
6. A trace of $node->taxonomy in taxonomy.module reveals that it is empty.

Now, is this simply because the node object is not passed by reference? If so, any ideas on how I could create the functionality desribed in the case without altering the drupal core? I gave thought to using node_submit() or taxonomy_node_save(), but, from my understanding, those would only result in multiple DB queries; the latter creates duplicate nodes and both methods result in duplicate calls to taxonomy_node_save() with an empty $node->taxonomy (resulting in empty taxonomy references for the inserted node) due to the behavior of node.module's call to some.module's _insert hook.

Or am I completely off my rocker?

Cheers!

-t-

mIRC to Drupal

I have searched on IRC and mIRC though I admit that my search was a bit hasty. I really want to submit this idea to the community.

The idea is more of an mIRC scripting matter than an Drupal one, though a Drupal module which deals with IRC would be amazing.

simple username

I have a very simple question. I'm somewhat new to Drupal, and am trying to simply obtain and echo the current user's name. I've been working on doing this, but can't quite get it to work. I'd appreciate the help very much.

Thank you.

How to document events, interviews, in chronological order

I'm not sure if this is the best forum to raise this issue, but here goes:

I have been working with a client to put together a website that will compile information about "best practices" in an issue that is highly-politicized, but shouldn't be. Our goal is to put together materials -- in the form of interviews, transcripts, reports, surveys, meeting minutes -- attached to a "country" taxonomy, that also needs to be cross-referenced by date or date range.

Our desire is to present events about which people have conflicting perceptions on "one page" so to speak by presenting the materials in chronological order so that the participants can get a good picture of what one groups perceptions of events was vs another groups at any particular time.

I've thought about approaching this as a taxonomy problem, but after ruminating a bit about it, it seems to be a new category of thing to track for each node.

I'm pretty new to MySQL/PHP, but I'm wondering if a new date field in node combined with a slightly modified story interface would do the trick (at least for the data gathering). Ideally, it would be cool if a user could go to country, click on a year or month, and then get a chronological listing of material related to that country.

I'm just floundering around right now. The client doesn't have development $ this fiscal year, but may have some money next FY (it's a govt. agency so they may have money again in October). Does anyone have any thoughts/ideas how I might go about approaching this problem?

Directory module

Is there any dircetory module? I'm need to create different types of contetn on my site. There must be news (drupal pages or stories) and directory/database on hotels, businesses, e.t.c. Early i was planning to create new node type module but after reading this http://drupal.org/node/view/2125 i'm not sure this is are good way.

"Post Here" module?

Has anyone attempted to create a "post here" module; in other words, if a user wanted to add content, they would automatically do so directly in the taxonomy that they are currently viewing?

I believe that would be easier for users, if they are viewing a specific category, the posting page would not ask them where they wanted to post and they wouldn't have the opportunity to make a mistake.

Of couse they could still use the regular "create content" link for universal access.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions