Skip to content
Snippets Groups Projects
Commit 170f088c authored by Jared Hancock's avatar Jared Hancock
Browse files

search: Fix advanced search saving

parent 2e571d57
No related branches found
No related tags found
No related merge requests found
...@@ -128,7 +128,8 @@ class SearchAjaxAPI extends AjaxController { ...@@ -128,7 +128,8 @@ class SearchAjaxAPI extends AjaxController {
else else
$data[$name] = $info['value']; $data[$name] = $info['value'];
} }
$form = $search->getForm($data); $form = $search->getForm();
$form->setSource($data);
if (!$data || !$form->isValid()) { if (!$data || !$form->isValid()) {
Http::response(422, 'Validation errors exist on form'); Http::response(422, 'Validation errors exist on form');
} }
......
...@@ -143,11 +143,10 @@ return false; ...@@ -143,11 +143,10 @@ return false;
<div style="position:absolute;bottom:0"> <div style="position:absolute;bottom:0">
<hr> <hr>
<form method="post"> <form method="post">
<fieldset> <div class="attached input">
<input name="title" type="text" size="27" placeholder="<?php <input name="title" type="text" size="27" placeholder="<?php
echo __('Enter a title for the search'); ?>"/> echo __('Enter a title for the search'); ?>"/>
<span class="action-button"> <a class="attached button" href="#tickets/search/create" onclick="javascript:
<a href="#tickets/search/create" onclick="javascript:
$.ajax({ $.ajax({
url: 'ajax.php/' + $(this).attr('href').substr(1), url: 'ajax.php/' + $(this).attr('href').substr(1),
type: 'POST', type: 'POST',
...@@ -165,8 +164,7 @@ $.ajax({ ...@@ -165,8 +164,7 @@ $.ajax({
}); });
return false; return false;
"><i class="icon-save"></i> <?php echo __('Save'); ?></a> "><i class="icon-save"></i> <?php echo __('Save'); ?></a>
</span> </div>
</fieldset>
</div> </div>
</div> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment