Index: branches/RC/core/units/themes/themes_config.php =================================================================== diff -u -N -r8929 -r9618 --- branches/RC/core/units/themes/themes_config.php (.../themes_config.php) (revision 8929) +++ branches/RC/core/units/themes/themes_config.php (.../themes_config.php) (revision 9618) @@ -14,12 +14,12 @@ 3 => 'event', 4 => 'mode', ), - + 'IDField' => 'ThemeId', 'StatusField' => Array('Enabled', 'PrimaryTheme'), 'PermSection' => Array('main' => 'in-portal:configure_themes'), - + 'TitleField' => 'Name', 'TitlePresets' => Array ( @@ -33,7 +33,7 @@ 'themes_edit_general' => Array('prefixes' => Array('theme'), 'format' => "#theme_status# '#theme_titlefield#' - !la_title_General!"), 'themes_edit_files' => Array('prefixes' => Array('theme', 'theme-file_List'), 'format' => "#theme_status# '#theme_titlefield#' - !la_title_ThemeFiles! (#theme-file_recordcount#)"), ), - + 'TableName' => TABLE_PREFIX.'Theme', 'SubItems' => Array('theme-file'), @@ -57,20 +57,20 @@ 'ItemSQLs' => Array ( '' => ' SELECT %1$s.* %2$s FROM %s LEFT JOIN '.TABLE_PREFIX.'Stylesheets st ON st.StylesheetId = %1$s.StylesheetId'), - + 'ListSortings' => Array ( '' => Array( 'Sorting' => Array('Name' => 'asc'), ) ), - + 'CalculatedFields' => Array ( '' => Array ( 'StyleName' => 'st.Name', 'LastCompiled' => 'st.LastCompiled', ), ), - + 'Fields' => Array( 'ThemeId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), 'Name' => Array('type' => 'string','not_null' => 1, 'required' => 1, 'default' => ''), @@ -85,7 +85,7 @@ 'StyleName' => Array ('type' => 'string', 'default' => ''), 'LastCompiled' => Array ('type' => 'int', 'default' => null), ), - + 'Grids' => Array( 'Default' => Array( 'Icons' => Array('default'=>'icon16_custom.gif', '1_1' => 'icon16_theme_primary.gif', '1_0' => 'icon16_theme.gif', '0_0' => 'icon16_theme_disabled.gif'), Index: branches/RC/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r9587 -r9618 --- branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 9587) +++ branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 9618) @@ -924,8 +924,15 @@ */ function ItemPrepareQuery(&$event) { - $sqls = $this->Application->getUnitOption($event->Prefix,'ItemSQLs'); - return isset($sqls[$event->Special]) ? $sqls[$event->Special] : $sqls['']; + $sqls = $this->Application->getUnitOption($event->Prefix, 'ItemSQLs', Array ()); + $special = array_key_exists($event->Special, $sqls) ? $event->Special : ''; + + if (!array_key_exists($special, $sqls)) { + // preferred special not found in ItemSQLs -> use analog from ListSQLs + return $this->ListPrepareQuery($event); + } + + return $sqls[$special]; } /** @@ -939,8 +946,8 @@ */ function ListPrepareQuery(&$event) { - $sqls = $this->Application->getUnitOption($event->Prefix,'ListSQLs'); - return isset( $sqls[$event->Special] ) ? $sqls[$event->Special] : $sqls['']; + $sqls = $this->Application->getUnitOption($event->Prefix, 'ListSQLs', Array ()); + return $sqls[ array_key_exists($event->Special, $sqls) ? $event->Special : '' ]; } /**