How to use Flag to trigger opening a custom CCK form for editing?

Events happening in the community are now at Drupal community events on www.drupal.org.
druplicate's picture

This seems like a very common task yet I can't seem to do it.

I want to have flag button on a page that an anonymous visitor can click to open a custom CCK form to enter email, and a short note, to be sent to an email address and have the form saved in the DB as a node so I can look at it later with Views. I also want the NID of the page that was flagged to be passed to the form. (I am using the dev version of Flag that allows anonymous flagging)

Webform can do this I believe but does not save items as nodes, so it's limited to what the module gives you.

Using Rules seemed the obvious choice here. I can do everything except open a form for editing. The only logical choice is "Node - Add new content", but that simply creates the node and does not open it for editing, unless I'm missing something.

I could always just do a redirect to the node creation menu item for the CCK form, but I'm not sure the NID of the flagged page would be atomically passed, unless session API handles it by keeping track of the anonymous user's session ID.

I would think that a common Rules action would be opening a CCK form to create a new record but allow editing too.

I even thought of using rules to go back and modify the CCK fields of the node that was just created but that might suffer from atomic NID issues too - not sure.

Any advice?

Tnx, Jeff

Comments

Webform fields in Views with anonymous user?

druplicate's picture

I just saw the NodeOne video (http://vimeo.com/18701843) on how to get Webform data fields into Views, so I guess it's possible to do it that way, BUT will it work with an anonymous user?

Node redirect doesn't work either

druplicate's picture

I changed the action to node redirect to the CCK node creation page as an experiment but nothing happens. When the node is flagged it does trigger the rule because I added a test action to print a dummy system message, which worked.

The result is the same whether the user is superadmin or anonymous. Permissions are set correctly.

I changed the Rules redirect

druplicate's picture

I changed the Rules redirect action to a simple static page on the site as a test, then right-clicked the flag link to open in a new tab, but it just opens the same page the flag link was on.

The Rules debugging output looks normal and indicates that the redirect action occurred.

Then I changed the action to execute this PHP code: <?php drupal_goto(node/add/my-properties);?> and the result is the same.

I've noticed a lot of people having difficulty with the redirect action, but found nothing to help me.

I'm assuming this is most likely a conflict with some other part of Drupal. Any hints as to where to look?

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: