------------------------------------------------------------
revno: 1108
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Tue 2012-02-21 22:00:07 +0100
message:
Bug 908807 corrected
modified:
libs/Engine_aiki.php
libs/widgets.php
--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk
Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'libs/Engine_aiki.php'
--- libs/Engine_aiki.php 2012-02-21 20:34:14 +0000
+++ libs/Engine_aiki.php 2012-02-21 21:00:07 +0000
@@ -1222,21 +1222,22 @@
foreach ($matches['1'] as $i=>$widget_info) {
$widget_para = explode("|", $widget_info);
- $widget_id = $aiki->widgets->get_widget_id($widget_para[0]);
- $normal_select = ( isset($widget_para[1]) ? $widget_para[1] : "" );
-
- $widget_data = $db->get_row(
- "SELECT * FROM aiki_widgets WHERE id='{$widget_id}' LIMIT 1");
-
- // widget css is added
- if ( trim($widget_data->css) <> "" &&
- !in_array( $widget_data->id, $this->widgets_css)) {
- $this->widgets_css[]= $widget_data->id ;
- }
- $widget_html = $this->createWidgetContent($widget_data, $normal_select);
-
-
-
+ $widget_data = $aiki->widgets->get_widget($widget_para[0]);
+
+ if ( is_null( $widget_data ) ) {
+ $widget_html = is_debug_on() ?
+ sprintf( t("Widget %s doesn't exist"), $widget_para[0]):
+ "" ;
+ } else {
+ // widget css is added
+ if ( trim($widget_data->css) <> "" &&
+ !in_array( $widget_data->id, $this->widgets_css)) {
+ $this->widgets_css[]= $widget_data->id ;
+ }
+ $normal_select = ( isset($widget_para[1]) ? $widget_para[1] : "" );
+ $widget_html = $this->createWidgetContent($widget_data, $normal_select);
+ }
+
// if the same widget appears two times..it will be replaced.
$widget = str_replace($matches[0][$i], $widget_html, $widget);
=== modified file 'libs/widgets.php'
--- libs/widgets.php 2012-02-19 20:19:24 +0000
+++ libs/widgets.php 2012-02-21 21:00:07 +0000
@@ -109,7 +109,7 @@
*/
function get_widget($widgetNameOrId, $checkSite = true) {
- return $this->get_widget_helper($widgetNameOrId, true, $direct);
+ return $this->get_widget_helper($widgetNameOrId, true, $checkSite);
}
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp