Forums / Zen Cart Code Suggestions / thoughts on ADMIN/includes/functions/html_output.php

thoughts on ADMIN/includes/functions/html_output.php

Views: 89

Results 1 to 5 of 5
19 Jan 2019, 4:37 PM
#1
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

thoughts on ADMIN/includes/functions/html_output.php

v156.

there are a number of die statements here. which would be MUCH more beneficial if they had a backtrace on them; ie.

debug_print_backtrace();
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>Function used:<br><br>zen_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');

it would be nice to use the @lat9 enable error logging to create a log file, if we do not want to print it to a screen, but unfortunately that currently requires a php error to make use of it (which this is not).

my question is whether it is worth wild and/or beneficial to modify the existing script to include the backtrace for v156 and display on the screen, or to try and create a log file, or to hope for better backtrace info in v2 version of ZC and leave as is.

thoughts?

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

19 Jan 2019, 6:38 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: thoughts on ADMIN/includes/functions/html_output.php

Better, I think, to just let trigger_error report the issue rather than die-ing.

trigger_error("zen_href_link($page, $parameters, $connection), unable to determine the page link.", E_USER_ERROR);
exit();  //-Not needed, since the E_USER_ERROR forces the exit ...
19 Jan 2019, 9:23 PM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: thoughts on ADMIN/includes/functions/html_output.php

Carl, would you like to submit a PR?

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

19 Jan 2019, 11:49 PM
#4
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: thoughts on ADMIN/includes/functions/html_output.php

lat9:

Better, I think, to just let trigger_error report the issue rather than die-ing.

trigger_error("zen_href_link($page, $parameters, $connection), unable to determine the page link.", E_USER_ERROR);
exit(); //-Not needed, since the E_USER_ERROR forces the exit ...


thanks @lat9.  although it does seem like the script continues.  so i will keep the die statement in there.

> **swguy:**
>
> Carl, would you like to submit a PR?

@swguy, i'll see if my foo is up to date and give it a whirl...

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

19 Jan 2019, 11:58 PM
#5
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: thoughts on ADMIN/includes/functions/html_output.php

I feel the foo is strong in you.
But if you need help, go here: https://docs.zen-cart.com/Contributing/main

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.