Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 215440 Details for
Bug 379039
[pmi] Display project specific information for project-related content types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for shortened hook name
Patch+for+Bug+379039+-+%5Bpmi%5D+Display+project+specific+information+for+projec.patch (text/plain), 3.01 KB, created by
Nathan Gervais
on 2012-05-11 00:45:03 EDT
(
hide
)
Description:
Patch for shortened hook name
Filename:
MIME Type:
Creator:
Nathan Gervais
Created:
2012-05-11 00:45:03 EDT
Size:
3.01 KB
patch
obsolete
>From 3142fadaf58d34bb28c9344107ac5ccb8482adda Fri, 11 May 2012 00:43:15 -0400 >From: Nathan Gervais <nathan@eclipse.org> >Date: Fri, 11 May 2012 00:41:04 -0400 >Subject: [PATCH] Patch for Bug 379039 - [pmi] Display project specific information for project-related content types to rename / shorten the hook name being called and fixed a variable name left out of the refactoring > >Also adding a hook to the releases module. > >diff --git a/sites/all/modules/custom/features/projects/project_pages/project_pages.module b/sites/all/modules/custom/features/projects/project_pages/project_pages.module >index 1a9dd62..38e030a 100644 >--- a/sites/all/modules/custom/features/projects/project_pages/project_pages.module >+++ b/sites/all/modules/custom/features/projects/project_pages/project_pages.module >@@ -103,11 +103,11 @@ > * @see hook_projects_related_project > * @param StdClass $node A Drupal node. > */ >-function project_pages_projects_related_project($node) { >+function project_pages_related_project($node) { > $projects = array(); > if ($node->type == 'page') { > if (isset($node->field_page_parent_project[$node->language])) { >- $project_nid = $object->field_page_parent_project[$node->language][0]['nid']; >+ $project_nid = $node->field_page_parent_project[$node->language][0]['nid']; > $projects[] = Project::getInstance(node_load($project_nid)); > } > } >diff --git a/sites/all/modules/custom/features/projects/projects.module b/sites/all/modules/custom/features/projects/projects.module >index 5533e18..13535aa 100644 >--- a/sites/all/modules/custom/features/projects/projects.module >+++ b/sites/all/modules/custom/features/projects/projects.module >@@ -225,7 +225,7 @@ > return call_user_func(array($object, 'getProject')); > > // Try the hook to sort it out. >- $projects = module_invoke_all('projects_related_project', $node); >+ $projects = module_invoke_all('related_project', $node); > // Regardless of what we do module_invoke_all returns an array, > // we're always going to take the first one. > if (count($projects)) return $projects[0]; >diff --git a/sites/all/modules/custom/features/releases/releases.module b/sites/all/modules/custom/features/releases/releases.module >index 81909aa..28eff46 100644 >--- a/sites/all/modules/custom/features/releases/releases.module >+++ b/sites/all/modules/custom/features/releases/releases.module >@@ -447,6 +447,25 @@ > return $links; > } > >+/** >+* Implements hook_projects_related_project. If the page is >+* associated with a project, return the project. >+* >+* @see hook_projects_related_project >+* @param StdClass $node A Drupal node. >+*/ >+function releases_related_project($node) { >+ $projects = array(); >+ if ($node->type == 'release') { >+ if (isset($node->field_release_parent_project[$node->language])) { >+ $project_nid = $node->field_release_parent_project[$node->language][0]['nid']; >+ $projects[] = Project::getInstance(node_load($project_nid)); >+ } >+ } >+ return $projects; >+} >+ >+ > // function _releases_subprojects_autocomplete($string) { > // $matches = array(); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 379039
:
215439
| 215440 |
215492