From: Steve Sutton Date: Fri, 14 Oct 2016 17:02:02 +0000 (-0400) Subject: Update for not finding package. X-Git-Tag: v1.2.0^2~7 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=8ee883adadabb93cb79260f1409d6d22a1dc19cd;p=web%2FTroutCreek.git Update for not finding package. If you don't find the package then don't try to call the object. --- diff --git a/package.php b/package.php index c9eb9ab..c030267 100644 --- a/package.php +++ b/package.php @@ -5,24 +5,26 @@ $package_id = filter_var($_REQUEST['package_id'], FILTER_VALIDATE_INT); if ( $package_id ) { $package = Toolkit_Packages_Package::fetchById( - Toolkit_Database::getInstance(), + Toolkit_Database::getInstance(), $package_id ); - $output = '
' - . '
'; - $output .='

' . $package->getTitle() . '

'; - if ( $package->getImage() ) { - $output .= ''; + if ( is_object( $package ) && $package instanceof Toolkit_Packages_Package ) { + $output = '
' + . '
'; + $output .='

' . $package->getTitle() . '

'; + if ( $package->getImage() ) { + $output .= ''; + } + $output .= '
'; + $output .= '
'.$package->getSavings().'
'; + $output .= '
'.$package->getDateRange().'
'; + $output .= '
'; + $output .= $package->getDescription(); + $output .= '
'; + $output .= '
'; } - $output .= '
'; - $output .= '
'.$package->getSavings().'
'; - $output .= '
'.$package->getDateRange().'
'; - $output .= '
'; - $output .= $package->getDescription(); - $output .= '
'; - $output .= '
'; } echo $output; ?> - \ No newline at end of file +