I start a new site where I have projects an issues
I the user is on a project site he should be able to click an ADD function to insert a new issue.
The linking between project and issue shoudl be made automaticaly in the background.
the end result should be an issue linked to the activ project
Thank you for your suggestions
Comments
Comment #1
kvit commentedI spent several hours today trying to do the same. Here are my steps (I just changed content type names to yours):
1) enable Rules and Rules Link modules;
2) Add Rules link attached to "Project" Bundle;
Set actions for rules link:
3) Add a variable "list-of-entities-for-relation" of type: List of any entity items;
4) Add an item "node" to "list-of-entities-for-relation" (add current project as relation endpoint);
5) Create a new entity of type "Issue"
6) Save entity - force immediate saving (to get node-id for a new issue)
7) Add an item "entity-created" to "list-of-entities-for-relation", prepend the item to the front if it is source for relation;
8) Create a new entity of type "Relation" with endpoints from "list-of-entities-for-relation"
9) Save entity "Relation"
10) Page redirect to [entity-created:edit-url] (so that the user could finish creating Issue which is already related to the project).
11) Additional small rule with conditiion that if the user clicking the link is anonymous, then redirect to login/register.
Comment #2
stoltoguzzi commentedhello kvit, thank you for your help, this is working great.
one problem I see, the user can not deside to abort the issue is stored in any cases.
my thinking was about so separate:
first rule to define the parent (project) id as a variable
then in the second rules, on save, to get this variable and to linkt them togehter.
but as far as I can see there is no way to store some kind of global variable?
Comment #3
naught101 commentedMight be worth checking out the http://drupal.org/project/project and http://drupal.org/project/project_issue modules.. they're designed just for this.
Comment #4
stoltoguzzi commentedThank you, yes I know this module but I'm on D7 and the project would be to big for what I'm looking for.
Comment #5
stoltoguzzi commentedI made some progress:
- the current node-id (father) is stored during on "content is viewed" event executing some PHP -Code
- a second rule I defined for "After saving new content"
- Create Variable type list of any entity itmes
- added the just saved node-id
- and now the problem, I defined an integer variable my_new_id to get back the father id from this session variable. But how to assign this value to an rules variable? Id tried:
but this does not work, can not adress a rules variable in PHP?
Comment #6
Sahin commenteddisturbing typo :)
Comment #7
kvit commentedstoltoguzzi, you may find what you need in this video:
http://dev.nodeone.se/en/customized-interface-for-creating-relations-wit...
Many thanks to Itangalo!!
Comment #8
naught101 commentedAppears to have been resolved over a year ago..