Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 379039
Collapse All | Expand All

(-)a/sites/all/modules/custom/features/projects/project_pages/project_pages.module (-2 / +2 lines)
Lines 103-113 Link Here
103
 * @see hook_projects_related_project
103
 * @see hook_projects_related_project
104
 * @param StdClass $node A Drupal node.
104
 * @param StdClass $node A Drupal node.
105
 */
105
 */
106
function project_pages_projects_related_project($node) {
106
function project_pages_related_project($node) {
107
  $projects = array();
107
  $projects = array();
108
  if ($node->type == 'page') {
108
  if ($node->type == 'page') {
109
    if (isset($node->field_page_parent_project[$node->language])) {
109
    if (isset($node->field_page_parent_project[$node->language])) {
110
      $project_nid = $object->field_page_parent_project[$node->language][0]['nid'];
110
      $project_nid = $node->field_page_parent_project[$node->language][0]['nid'];
111
      $projects[] = Project::getInstance(node_load($project_nid));
111
      $projects[] = Project::getInstance(node_load($project_nid));
112
    }
112
    }
113
  }
113
  }
(-)a/sites/all/modules/custom/features/projects/projects.module (-1 / +1 lines)
Lines 225-231 Link Here
225
			return call_user_func(array($object, 'getProject'));
225
			return call_user_func(array($object, 'getProject'));
226
226
227
	// Try the hook to sort it out.
227
	// Try the hook to sort it out.
228
	$projects = module_invoke_all('projects_related_project', $node);
228
	$projects = module_invoke_all('related_project', $node);
229
	// Regardless of what we do module_invoke_all returns an array,
229
	// Regardless of what we do module_invoke_all returns an array,
230
	// we're always going to take the first one.
230
	// we're always going to take the first one.
231
	if (count($projects)) return $projects[0];
231
	if (count($projects)) return $projects[0];
(-)a/sites/all/modules/custom/features/releases/releases.module (+19 lines)
Lines 447-452 Link Here
447
  return $links;
447
  return $links;
448
}
448
}
449
449
450
/**
451
* Implements hook_projects_related_project. If the page is
452
* associated with a project, return the project.
453
*
454
* @see hook_projects_related_project
455
* @param StdClass $node A Drupal node.
456
*/
457
function releases_related_project($node) {
458
  $projects = array();
459
  if ($node->type == 'release') {
460
    if (isset($node->field_release_parent_project[$node->language])) {
461
      $project_nid = $node->field_release_parent_project[$node->language][0]['nid'];
462
      $projects[] = Project::getInstance(node_load($project_nid));
463
    }
464
  }
465
  return $projects;
466
}
467
468
450
// function _releases_subprojects_autocomplete($string) {
469
// function _releases_subprojects_autocomplete($string) {
451
//   $matches = array();
470
//   $matches = array();
452
  
471
  

Return to bug 379039