Last active
August 29, 2015 14:04
-
-
Save segovia94/858eb55863fc1594901e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// node/add/project-review/%nid | |
$nid = arg(3); //Gets the nid from the url | |
if ($nid) { | |
//get the project node | |
$node = node_load($nid); | |
//add the entity reference to the project of it does not already have one | |
if (empty($form['field_project_refence'][LANGUAGE_NONE][0]['target_id']['#default_value'])) { | |
$form['field_project_refence'][LANGUAGE_NONE][0]['target_id']['#default_value'] = $node->title . ' (' . $node->nid . ')'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment