Hi,

I'm desperately looking for a similar module like "Addnode" (http://drupal.org/project/addnode, unmaintained) or "Add and Reference" (http://drupal.org/project/add_n_reference, unmaintained since 4.7.x-1.x-dev).

I simply need something, that allows me to design a flexible workflow with a bunch CCK-based content types, that depend on each other (e.g. if a node with content typ A does not exist yet, a node with content type B must not be created beforehand). The user of the site should be lead to the process of creating a chain of valid nodes without getting frustrated due to unsolved dependencies.

Pageroute is not an option since it seems not to support conditions (e.g. if node with content typ A already exists, skip creating new node of content type B and continue to next dependency, e.g. node with content type C).

I'd love to hear about any suggestions,

Thanks & greetings, -asb

Comments

missym’s picture

Try Workflow NG content link. Write a small module to set up your defaults.

asb’s picture

Hi MissyM,

thanks for the pointer; I installed "Workflow NG" with "content link" and tried modelling the workflow I need. As far as I've seen, "Workflow NG" does not even come close to making this work. However, considering the complexity of this module, I might be completely wrong.

Basically, "Workflow NG" offers so called "events" like "Content has been created", or "Content is going to be saved". What I need, is a different condition: If content assiciated by a CCK nodereference field already exists, continue to the next step, and don't try to save the current node, but remember it's content; if required content does not yet exist, create a node *before* saving the current node (which would fail due to empty required fields, or contain bogus data, which would have to be corrected afterwards. As far as I understand it, this can't emulate the behaviour of "Addnode" or "Add and Reference", at least not without writing a lot of code (which is not an option since I'm using Drupal and it's modules because I *can't* write programs).

I'll try to illustrate this by an easy example: A workflow for creating a performance. A performance (e.g. a concert) has a program (titles that are played), that is performed, it has a location, where it is being performed, and it has a number of artists that take part in the performance; probably, the program will be part of the repertoire of the performers. All those entities are modelled with different content types (like "performance", "program", "repertoire", or "artist"); they are connected through a chain of dependencies, or relations: Every performance must have a location, and must have a number of artists, and so on. If I want to crate a node of content type "performance", e.g. I need to be able to (a) select existing artists (provided by a CCK node reference to content type "artists"), and/or (b) create not-yet-existing artists (represented by node of the mentioned content type). The chain of dependencies continues and ends somewhere, e.g. with an composer (similar dependencies would apply for a movie, or a car, or whatever can be modelled with CCK). Sticking to the example:

* performance (depends on) -> program -> repertoire -> composer -> place of birth/death

Also,

* performance (depends on) -> location -> city/address

and

* performance (depends on) -> artist

To create a new performance, in worst case, I have to provide the possibility to enter/create

* one program node
* one repertoire node
* one composer node
* one place of death node
* one place of birth node
* one location node
* one city/address node
* one or multiple artist nodes

In every case, the needed node might already exist, or might have to be created. In any case, the data entered so far must not be discarded before the dependencies are fulfilled completely (this data models works fine, if the user is able to enter some bogus data, create the required node, then goes back and corrects the bogus data entered before. This might work for me, but not for an untrained user).

The event "Content has been created" from "Workflow NG" does not work, since the content (= new performance) must not be saved before all artists are entered/created. So I have to use "Content is going to be saved". Now I can add a "Condition", and an "Action". As far as I can see, no existing condition gives me what I need (e.g. "Content has type" - I need something like "if content already exists do ... else do..."); probably this might work with "Execute custom PHP code". The action "Add new content" would do the trick, but does not offer the option I need, which is: *Either* select existing artist from CCK node reference field, *or* create a new one. I simply don't see where to get the necessary condition. The workflow I can model with "Workflow NG" is basically the same which I could get with the "Pageroute" module.

I went through the documentation (http://drupal.org/node/156288) and Tutorials (http://drupal.org/node/156290) but couldn't find any example similar to what I need; either I don't understand how this module operates, or it simply can't do the job. Any suggestions what I'm doing wrong, or what would be needed to do this with "Workflow NG"?

Thanks & greetings, asb

missym’s picture

This is indeed an intricate model. I saw CCK Wizard and Pageroute have some of the features you are after. I have read intriguing things about Panels.

Here was my similar problem with my solution: for each node of Content Type A there may be many nodes of Content Type B. I wrote a little module to put all the Node Type B on the view node screen of Content Type A. I could have used CCK store-a-view-in-a-field but I didn't for control issues.

My problem was that I needed to add and edit Node Type Bs. I used my little module to put an edit link to each Node B line that directed it to node/123/edit. Beauty. I used Workflow NG to add a Node B. In my module, I prepopulated the Content Type A's NID in the relational field when they hit add. Drupal does the heavy lifting of displaying the form.

It looks like you could write a little module to add some fields to your add screen and a help you save them properly. Before going to that extent, you might set up a test system and try all of the potential modules.

Another thing to consider is your workflow. If updating all the concerts is within your control, you can puts some views in blocks so you can see right away what data is available - make yourself a little control panel screen. I don't make things seamless unless it's for a client. If I'm driving, I tend to be more pragmatic. Remember if you give add access too freely, you will have cities named "test","tEsttttt", etc.

You could make a little pre-node-add form that shows a list of, for example, birth cities with a blank that allows an immediate add, composers with a blank that allows an immediate add. Just to verify that the data is available. Again, much of this has to do with how much control you have over the data entry process. If strangers are entering data, it has to be as dumbproof as possible.

I wish I could be more helpful. Thank you for taking the time to write such a thoughtful description. If Panels or another module seems to be a good candidate, I encourage you to put it up on a test server and try it out.

Best wishes on your project.

Missy.

** re panels - please see this: http://www.angrydonuts.com/panels-what-is-context

gpk’s picture

Subscribing

gpk
----
www.alexoria.co.uk

summit’s picture

Subscribing, greetings, Martijn

ndwilliams3’s picture

asb,

I am working on a similar events project and have a similar issue linking and creating nodes with nodereference. I was wondering if you made any progress in solving your issue with addnode or workflow ng or another module?

mistresskim’s picture

If you don't mind pop-up windows this might be useful:

http://drupal.org/project/popups_reference

2ndChanceTech’s picture

there's addnode_beta not stored on drupal yet, but a new maintainer took over addnode and fixed a couple bugs, added a couple features... search the forums for it and you'll find it. After trying everything it turned out to be the best I've found. Too bad it can't be found in the downloads... stops people from finding it easier I suppose.

ndwilliams3’s picture

The site I am working on is going live in one week. Deadlines, got to love them! I don't have a lot of time to test modules to insure they are working properly. I looked at addnode, but it seemed there were issues with the stable release v1.2. I believe I came across what you are referring to in the forum. I was not sure if it was stable enough for a production site. Have you been using it long? Any issues?

2ndChanceTech’s picture

the only issue so far is when used a panels override for the node/add and node/edit that the lightbox displays off center and slightly off screen. this didn't happen when panels wasn't involved, and I'm sure it's an easy fix, just haven't looked yet.

other then that i haven't had issues.

only tested it creating about 50 nodes... but i use it on 20 different content types and i use it about 15x per type, as all my nodes can reference each other. so far so good.

bhavers’s picture

Hi, maybe good to mention that popups is a bit misleading name... it creates a really neat overlay on the screen instead of annoying popups.

I had exactly the same question as asb and nothing seemed to help.
I first skipped over popup_reference as it gave me the impression that it presented annoying popup windows that will be blocked by the majority of browsers. But, desperate in the end for not being able to find a solution, i gave it a try and it's absolutely cool!
It doesn't create popup windows but an overlay on the screen. Popup blockers will not break your site, there's no change the popup to disappears behind the main browser windows and above all... it looks really looks cool.
It might not solve all situation that asb described. But at least for the basic 'node reference' scenarios it will.

Just thought to mentioned it in case somebody else was about to skip over this like me.

ibandyop’s picture

How did you finally solve the problem ?

I am looking at the following modules to see I can solve a similar problem.

http://drupalmodules.com/module/conditions
make the condition as a whole TRUE or FALSE - needs PHP

http://drupal.org/project/pageroute
leads users through multiple pages / node creation form or a node display

http://drupal.org/project/insert_view
tag syntax : embed content lists generated by the Views module into node bodies

http://drupal.org/project/viewfield
saved query in a view - display only
When the node is displayed, the view is run and the content is inserted into the body of the node.

http://drupal.org/project/viewreference
reference a view

http://drupal.org/project/workflow_fields
invisible or read-only depending on the current workflow state