Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined index: drupal dans update_requirements() #29

Open
B-Prod opened this issue Mar 5, 2013 · 1 comment
Open

Undefined index: drupal dans update_requirements() #29

B-Prod opened this issue Mar 5, 2013 · 1 comment

Comments

@B-Prod
Copy link

B-Prod commented Mar 5, 2013

The function update_requirements() check for the "drupal" project, which does not exists since "pressflow" is used instead.

Awaiting a specific URL for checking update status (@see pressflow/6#30) is created, it could be great to avoid the display or update error message by modifying the update module.

I actually have a patch against Pressflow to avoid such issue, but text (or patch) file are not allowed here :(

@B-Prod
Copy link
Author

B-Prod commented Mar 5, 2013

OK, I got it now. Here is the patch:

diff --git a/modules/update/update.compare.inc b/modules/update/update.compare.inc
index 6e0c5fe..ef75124 100644
--- a/modules/update/update.compare.inc
+++ b/modules/update/update.compare.inc
@@ -68,6 +68,9 @@ function update_get_projects() {
         _update_process_info_list($projects, $module_data, 'module', FALSE);
         _update_process_info_list($projects, $theme_data, 'theme', FALSE);
       }
+      // Do not check for Pressflow release while a dedicated URL does not exist.
+      // @see https://github.com/pressflow/6/issues/30
+      unset($projects['pressflow']);
       // Allow other modules to alter projects before fetching and comparing.
       drupal_alter('update_projects', $projects);
       // Cache the site's project data for at most 1 hour.
@@ -168,7 +171,7 @@ function _update_process_info_list(&$projects, $list, $project_type, $status) {
     // or theme. If the project name is 'drupal', we don't want it to show up
     // under the usual "Modules" section, we put it at a special "Drupal Core"
     // section at the top of the report.
-    if ($project_name == 'drupal') {
+    if ($project_name == 'pressflow') {
       $project_display_type = 'core';
     }
     else {
@@ -182,7 +185,7 @@ function _update_process_info_list(&$projects, $list, $project_type, $status) {
     }
     // Add a list of sub-themes that "depend on" the project and a list of base
     // themes that are "required by" the project.
-    if ($project_name == 'drupal') {
+    if ($project_name == 'pressflow') {
       // Drupal core is always required, so this extra info would be noise.
       $sub_themes = array();
       $base_themes = array();
@@ -252,7 +255,7 @@ function update_get_project_name($file) {
     $project_name = $file->info['project'];
   }
   elseif (isset($file->info['package']) && (strpos($file->info['package'], 'Core') === 0)) {
-    $project_name = 'drupal';
+    $project_name = 'pressflow';
   }
   return $project_name;
 }
diff --git a/modules/update/update.install b/modules/update/update.install
index baf4953..3907c07 100644
--- a/modules/update/update.install
+++ b/modules/update/update.install
@@ -31,10 +31,6 @@ function update_requirements($phase) {
     if ($available = update_get_available(FALSE)) {
       module_load_include('inc', 'update', 'update.compare');
       $data = update_calculate_project_data($available);
-      // First, populate the requirements for core:
-      $requirements['update_core'] = _update_requirement_check($data['drupal'], 'core');
-      // We don't want to check drupal a second time.
-      unset($data['drupal']);
       if (!empty($data)) {
         // Now, sort our $data array based on each project's status. The
         // status constants are numbered in the right order of precedence, so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant