Hi,

here is a patch containing some fixes and improvements:
- fixing of E_NOTICES
- fixing of sentry_seo.module - update
- fixing of some other problems

Comments

carsten müller’s picture

StatusFileSize
new8.75 KB

minor improvement to last patch

carsten müller’s picture

StatusFileSize
new1.19 KB

another patch to fix two E_Notices
made by amatzies - http://drupal.org/user/1142832

carsten müller’s picture

StatusFileSize
new10.64 KB

another patch for the admin settings of the included modules to display them as local tasks (tabs)

snufkin’s picture

I commited the patch in #2 and #3. I really appreciate the patches and want to help getting them into the module, but it would help my job tremendously if you could open a new issue for each main patch and not adding them as separate comments.

This is also relevant for the last patch for instance, I am very happy to fix coding style issues, but when they are coupled with bugfixes the patch is very hard to review.

snufkin’s picture

Status: Needs review » Needs work

I am trying to commit the notice fixes one by one, but if you could explain the SEO and HTTP check fixes that would be helpful.

carsten müller’s picture

Hi snufkin,

sorry, ok i will open new issues in the future. But in main, most of the patches just fix warnings and PHP E_Notice errors.
You can check set by changing your error_reporting to E_ALL. Default setting is E_ALL & ~E_Notice. So by default the notices are not displayed. The coding styles are fixes in my IDE. I just set up my notebook.

here some explanations of the top patch (#0)

sentry_server.module

line 258

if (!empty($sentry_site->hostname)) {

This is a fix to catch warnings if the hostname is not set. Before the foreach it would be nice to check also if $enabled_plugins is not empty

line 597:

   $http = array();
+  $count = 0;
   while ($record = db_fetch_object($result)) {
     if (!isset($first)) {
       $first = $record;
     }
+    
+    if (empty($http[$record->code])) {
+      $http[$record->code] = 0;
+    }
+    
     $http[$record->code]++;
      $count++;
   }

Before $count was just incremented. That causes an E-Notice because $count is not initialised. Same with $http[$record->code].

line 609:
same with $report['description'], $args and $class

sentry_performance.module
also some patches to fix E-Notices by initialising some variables

sentry_seo.module
some patches to fix E-Notices by initialising some variables

sentry_server_cron.module
initialising of $cron[$record->code] if empty

sentry_server_update.module
added check to just start the query if $project['title'] is really set

sentry_server_update_projectpage.inc
just initialised $output to fix E-Notice

carsten müller’s picture

Patch from #1

same as the first patch (#0), just added some initialisings of variables to fix further E_Notices

carsten müller’s picture

#2 - fix_notices patch

sentry_server.module
changed check from

if (function_exists($available_plugins[$key]['handler'])) {

to

if (isset($available_plugins[$key]['handler']) && function_exists($available_plugins[$key]['handler'])) {

So it will also be checked if $available_plugins[$key]['handler'] is set to avoid an E_Notice

sentry_server_update.module
Added $project->project_id = $project_id to fixwriting of project_id which was missing in $project object

carsten müller’s picture

#3 - admin link settings patch

sentry_server.module
no changes, my IDE made a wrong patch. There are no changes

sentry_server_cron.module and sentry_server_update.module
Just added 'type' => MENU_LOCAL_TASK, to the menu item. Then the Link is also dislayed as a tab on top of the settings. so it is easy to switch between the administration settings of sentry server sentry server cron and sentry server update. It is just a small improvement.

carsten müller’s picture

During my review i saw that there are many changes marked in he patch, which are no changes in deed. My IDE (Eclipse) made some mistakes. I will check that.