[COMPONENT][Search] Make search title field not required

This commit is contained in:
Hugo Sales 2021-12-11 22:20:25 +00:00
parent 1e8eea0434
commit 4be226edd5
Signed by untrusted user: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -59,7 +59,7 @@ class Search extends Component
if ($add_subscribe) { if ($add_subscribe) {
$form_definition[] = [ $form_definition[] = [
'title', TextType::class, ['label' => _m('Title'), 'attr' => ['title' => _m('Title for this new feed in your left panel')]], 'title', TextType::class, ['label' => _m('Title'), 'required' => false, 'attr' => ['title' => _m('Title for this new feed in your left panel')]],
]; ];
$form_definition[] = [ $form_definition[] = [
'subscribe_to_search', 'subscribe_to_search',
@ -96,6 +96,7 @@ class Search extends Component
/** @var SubmitButton $subscribe */ /** @var SubmitButton $subscribe */
$subscribe = $form->get('subscribe_to_search'); $subscribe = $form->get('subscribe_to_search');
if ($subscribe->isClicked()) { if ($subscribe->isClicked()) {
// TODO ensure title is set
Event::handle('AppendFeed', [$actor, $data['title'], 'search', ['q' => $data['search_query']]]); Event::handle('AppendFeed', [$actor, $data['title'], 'search', ['q' => $data['search_query']]]);
$redirect = true; $redirect = true;
} }