From e36142a6a9a2e0f0b44019b546641fbd4c84ceb5 Mon Sep 17 00:00:00 2001 From: Benaka Moorthi Date: Sat, 14 Sep 2013 15:38:29 -0400 Subject: [PATCH] Refs #4041, default to HtmlTable if visualization ID is invalid and filled out a function doc. --- core/DataTableVisualization.php | 6 +++--- core/ViewDataTable.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/DataTableVisualization.php b/core/DataTableVisualization.php index 04760b04625..83a60218918 100644 --- a/core/DataTableVisualization.php +++ b/core/DataTableVisualization.php @@ -219,14 +219,14 @@ public static function getVisualizationInfoFor($visualizations) * Returns the visualization class by it's viewDataTable ID. * * @param string $id The visualization ID. - * @return string The visualization class name. - * @throws \Exception if $id is not a valid visualization ID. + * @return string The visualization class name. If $id is not a valid ID, the HtmlTable visualization + * is returned. */ public static function getClassFromId($id) { $visualizationClasses = self::getAvailableVisualizations(); if (!isset($visualizationClasses[$id])) { - throw new \Exception("Invalid DataTable visualization ID: '$id'."); + return $visualizationClasses['table']; } return $visualizationClasses[$id]; } diff --git a/core/ViewDataTable.php b/core/ViewDataTable.php index 8f2b0a88c80..09634c04b15 100644 --- a/core/ViewDataTable.php +++ b/core/ViewDataTable.php @@ -408,7 +408,8 @@ private function setViewProperty($name, $value) } /** - * TODO + * Sets visualization properties using data in a visualization's default property values + * array. */ private function setVisualizationPropertiesFromMetadata($properties) {