Project:PHP Error Report
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

I have been working on upgrading this module to D7. I have made a lot of progress but seem to be a bit stuck at the moment. I'm attaching the whole module because it isn't worth doing a patch for at this point. I have a lot of extra code commented out to ensure I am able to go back if something doesn't work.

I have been able to get it to install and display the report along with the list of links but when it displays the error report I get the following errors.
Notice: Undefined index: !message in _php_errors_show() (line 173 of /sites/all/modules/php_errors/php_errors.module).
Notice: Undefined index: %file in _php_errors_show() (line 173 of /sites/all/modules/php_errors/php_errors.module).
Notice: Undefined index: %line in _php_errors_show() (line 173 of /sites/all/modules/php_errors/php_errors.module).

that line is in the following section of code

<?php
   
foreach ($results as $result) {
     
$variables = unserialize($result->variables);
     
$error = $variables["!message"] . " in " . $variables["%file"] . " on line " . $variables["%line"] . ".";
     
$row = array();
     
$row[] = $result->count;
     
$row[] = format_date($result->timestamp, 'short');
     
$row[] = wordwrap(html_entity_decode($error), 60, "<br />", 1);
     
$row[] = l($result->location, $result->location);
     
$rows[] = $row;
    }
?>

basically what is happening is that when you pull the data from the watchdog table in the database it is a single variable that inserts the actual message with the replacement characters but in D7 for some reason you cannot use the special characters for the replacement. I do not know how they do it when they print the errors in the recent error log but I couldn't find the function that called that either. If anyone can help me out on this I will try to have an actual patch worthy of submitting next week.

Thanks in advance.

AttachmentSize
php_errors.tar_.gz10.1 KB

Comments

#1

Status:needs work» needs review

Well this still isn't working quite right but here is a patch if anyone else wants to take a look at it.

AttachmentSize
php-erros-upgrade-1428654-1.patch 21.81 KB

#2

i have some time this week i could likely finish this off (and add official release) but a couple questions:

- can you provide a zip rather than a patch to D6 version? i see you have both here but wasnt sure if the zip in initial post is your most current

- also, this module relies on cronplus and i think you and others have been working on that port as well; although not clear that it is finished yet; do you know it's status?

#3

Here is a zip of the most recent. Also I have been working on the cronplus port and I think it is finished. I will post the latest version at http://drupal.org/node/1097110

I assume that meant an actual zip and not tar/gz

AttachmentSize
php_errors.zip 107.82 KB

#4

zip or tar is fine. thanks.

#5

i haven't tried the cron part of this yet or the mail features but the basic pages now work with no errors

i'll likely add a 7.x-dev release later tonight and if you can do any further testing that would be great; once anyone tests/patches issues that may exist for the cron/mail parts of this, i will release a 1.0

thanks for your work in porting this over.

AttachmentSize
php_errors.zip 4.7 KB

#6

For the cron portion I added the ability to run it on demand for the testing. That works for me except that I cannot get the report to work properly. For some reason it isn't displaying the information as it should. If I can find the fix for it I will post it but to date no such luck.

If you need anything else to make this happen don't hesitate to let me know. I think this is a great project to keep people updated on their sites.

nobody click here