Commit 5161c4e9 authored by Nigel McNie's avatar Nigel McNie
Browse files

Fix a FIXME by assigning a default category if none has been specified

parent 76a5fa6c
......@@ -33,8 +33,11 @@ define('TITLE', get_string('editblocks', 'view'));
$view = new View(param_integer('id'));
$new = param_boolean('new');
// FIXME: we can't know the first category is 'aboutme'
$category = param_alpha('c', 'aboutme');
$category = param_alpha('c', '');
// Make the default category the first tab if none is set
if ($category === '') {
$category = get_field_sql('SELECT "name" FROM {blocktype_category} ORDER BY "name" LIMIT 1');
}
$view->process_changes($category, $new);
$columns = $view->build_columns(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment