Dependency Graph View Issue Relation Graph Vertical
related to child of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0020028phpList 3 applicationTheme - Trevelinpublic06-08-19 09:38
Reporterduncanc 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Product Version3.4.4 
Target Versionnext majorFixed in Version 
Summary0020028: When insert into message table fails the fatal error is not displayed by Trevellin theme
DescriptionDue 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.
TagsNo tags attached.

Activities

duncanc

16-07-19 22:17

updater  

duncanc

17-07-19 16:52

updater   ~0062565

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.

samtuke

17-07-19 16:58

administrator   ~0062566

Ouch, so the best fix is to ensure this particular error is handled by the script and does not generate a fatal error?

michiel

18-07-19 08:05

manager   ~0062567

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

duncanc

18-07-19 08:35

updater   ~0062568

Last edited: 18-07-19 08:38

View 2 revisions

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.



duncanc

18-07-19 08:38

updater  

duncanc

19-07-19 11:53

updater   ~0062569

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.