mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 11:01:04 +00:00
Merge pull request #7827 from wallabag/fix-redirection-action-search
Fix redirection after action in search results
This commit is contained in:
commit
93e877f086
4 changed files with 35 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
|
||||
{% set current_path = app.request.requesturi %}
|
||||
|
||||
<ul class="tools right">
|
||||
<li>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
{% endif %}
|
||||
{% include "@WallabagCore/Entry/Card/_content.html.twig" with {'entry': entry, 'withMetadata': true, 'subClass': 'metadata'} only %}
|
||||
|
||||
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
|
||||
{% set current_path = app.request.requesturi %}
|
||||
|
||||
<ul class="tools-list hide-on-small-only">
|
||||
<li>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
|
||||
{% set current_path = app.request.requesturi %}
|
||||
{% set list_mode = app.user.config.listMode %}
|
||||
{% set entries_with_archived_class_routes = ['tag_entries', 'search', 'all'] %}
|
||||
{% set current_route = app.request.attributes.get('_route') %}
|
||||
|
|
|
@ -1475,6 +1475,38 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
$this->assertCount(1, $crawler->filter($this->entryDataTestAttribute));
|
||||
}
|
||||
|
||||
public function testActionInSearchResults()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getTestClient();
|
||||
|
||||
$config = $this->getLoggedInUser()->getConfig();
|
||||
$config->setActionMarkAsRead(ConfigEntity::REDIRECT_TO_CURRENT_PAGE);
|
||||
$this->getEntityManager()->persist($config);
|
||||
|
||||
$entry = new Entry($this->getLoggedInUser());
|
||||
$entry->setUrl($this->url);
|
||||
$entry->setTitle('ActionInSearchResults');
|
||||
$this->getEntityManager()->persist($entry);
|
||||
$this->getEntityManager()->flush();
|
||||
|
||||
// Search on unread list
|
||||
$crawler = $client->request('GET', '/unread/list');
|
||||
|
||||
$form = $crawler->filter('form[name=search]')->form();
|
||||
$data = [
|
||||
'search_entry[term]' => 'ActionInSearchResults',
|
||||
];
|
||||
|
||||
$crawler = $client->submit($form, $data);
|
||||
$currentUrl = $client->getRequest()->getUri();
|
||||
$element = $crawler->filter('a[data-action="delete"]')->link();
|
||||
$client->click($element);
|
||||
$client->followRedirect();
|
||||
$nextUrl = $client->getRequest()->getUri();
|
||||
$this->assertSame($currentUrl, $nextUrl);
|
||||
}
|
||||
|
||||
public function dataForLanguage()
|
||||
{
|
||||
return [
|
||||
|
|
Loading…
Reference in a new issue