View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0020028 | phpList 3 application | Theme - Trevelin | public | 16-07-19 22:17 | 23-12-20 11:47 |
Reporter | duncanc | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Product Version | 3.4.4 | ||||
Target Version | next major | ||||
Summary | 0020028: When insert into message table fails the fatal error is not displayed by Trevellin theme | ||||
Description | Due to the way that the Trevellin theme dynamically changes html elements from hidden to visible, if phplist fails with a fatal error then the page is empty instead of the error message being displayed. When Dressprow is used then the error message is displayed, see screenshot. | ||||
Tags | No tags attached. | ||||
related to | 0020039 | resolved | Travelin does not show the following error: "Unable to create campaign, did you forget to update the database" |
|
|
|
After looking at how fatal errors are handled it appears that they are not really fatal. In almost all cases the code returns after displaying the error. But in this particular case, when inserting into the message table, the code exits which means that the html is not complete. That's ok for the Dressprow theme, but Trevellin relies, I think, on some javascript that is now not loaded so the page appears blank. |
|
Ouch, so the best fix is to ensure this particular error is handled by the script and does not generate a fatal error? |
|
Maybe the easiest is to include the theme footer when a fatal error happens. https://github.com/phpList/phplist3/blob/master/public_html/lists/admin/connect.php#L553 |
|
Changing this particular instance, unable to insert into the message table, to return instead of exiting and also setting some sort of status field ($done = 1) means that the error is displayed. The error is displayed in a much neater way than other "fatal errors". The Fatal_Error() function tries to discard output using ob_end_clean(), but send.php has an extra call to ob_start(), which means that all the prior output is kept. So a complete html page is generated. Compare that with the error displayed when trying to view subscriber details when a subscriber id does not exist. |
|
|
|
See https://github.com/phpList/phplist3/pull/569 which is not more than a quick fix for this particular problem. Maybe the error handling could be revised so that the error is displayed more neatly for all fatal errors. I can see that we don't want to do any further processing after an unexpected error, but returning to the caller which is usually just one level will mean that a complete html page is displayed. |
|
@mariana this has been fixed by a recent change https://github.com/phpList/phplist-ui-bootlist/commit/990bd02f12f8c0fb1985b012168147df9a2c00df |
|
Great. Closing this. |