Compare commits

..

41 Commits
2.2.2 ... 2.2.3

Author SHA1 Message Date
82307d88f2 Release wallabag 2.2.3 2017-05-17 17:53:42 +02:00
6830d92558 Merge pull request #3125 from wallabag/prepare-222
Prepare wallabag 2.2.3
2017-05-17 17:48:51 +02:00
c0e8e6037b Prepare wallabag 2.2.3 2017-05-17 17:21:14 +02:00
afc9875f28 Merge pull request #3117 from wallabag/fix-doc
Fixed documentation URL
2017-05-17 10:40:35 +02:00
6b94ee51b8 Fixed documentation URL 2017-05-17 09:03:04 +02:00
4e88a6a651 Merge pull request #3124 from wallabag/lock-guzzle-auth
Lock guzzle-site-authenticator to avoid errors
2017-05-17 09:02:22 +02:00
8581fcae90 Lock guzzle-site-authenticator to avoid error 2017-05-16 23:34:42 +02:00
092ed4a787 Merge pull request #3123 from X-dark/master
reorder contrib strings in about page
2017-05-16 14:50:25 +02:00
8544c7e4b6 reorder contrib strings in about page
this fixes #2891
2017-05-16 14:17:13 +02:00
91ba9a5975 Merge pull request #3095 from aaa2000/api-error-on-fail-fetch-content
Create a new entry via API even when its content can't be retrieved
2017-05-10 09:38:55 +02:00
a9357a8311 Remove the created entry to avoid side effects on other tests 2017-05-09 23:19:24 +02:00
a2ae05a61c Merge pull request #3076 from wallabag/hotfix/2979
Disable negative numbers in filters
2017-05-09 13:56:44 +02:00
1b1647175d Add some tests 2017-05-09 12:12:23 +02:00
c829b06ed8 Merge pull request #3097 from wallabag/update-license
Update graby* licenses
2017-05-09 09:47:20 +02:00
9d7d549712 Update graby* licenses 2017-05-09 09:22:50 +02:00
832fbd94c0 Merge pull request #3096 from aaa2000/fix-api-entries-pagination-with-perpage
Fix API pagination is broken if perPage is custom value
2017-05-09 09:12:15 +02:00
b60a666df2 Fix API pagination is broken if perPage is custom value
Fix #2720
2017-05-08 16:27:16 +02:00
08f29ae7b6 Create a new entry via API even when its content can't be retrieved
Fix #2988
2017-05-08 14:57:25 +02:00
f2beee5185 Merge pull request #3090 from aaa2000/translate-login-page-error
Translate error message in login page
2017-05-07 14:00:41 +02:00
f3c300e485 Translate error message in login page
Fix #2933
2017-05-06 22:21:04 +02:00
6603a9d649 Merge pull request #3082 from aaa2000/fix-form-errors-display
Fix display the form errors correctly
2017-05-05 07:01:28 +02:00
ab9eb5cdb7 Fix display the form errors correctly
Use `property_path` form option to map underscored form fields
to object properties

@see https://github.com/symfony/symfony/issues/9162#issuecomment-25431148

Fix #3067
2017-05-05 00:12:16 +02:00
1267905d28 Disable negative numbers in filters 2017-05-03 11:08:56 +02:00
a7c8f54570 Merge pull request #3072 from wallabag/hotfix/3061
Small typo in documentation fix #3061
2017-05-02 15:46:45 +02:00
0f26c285d4 Small typo in documentation fix #3061 2017-05-02 11:51:23 +02:00
9579003045 Merge pull request #3066 from wallabag/ignore-tests-exported-files
Ignore tests exported files
2017-04-29 22:51:32 +02:00
d49cdfe2ef Ignore tests exported files 2017-04-29 19:41:14 +02:00
8ee18fdabc Merge pull request #3064 from gileri/master
Correct create_application en string
2017-04-29 15:43:42 +02:00
ef88b37eb5 Correct create_application en string 2017-04-29 12:30:12 +02:00
138c352cd7 Merge pull request #3052 from shtrom/fix-relative-symlinks
Make symfony-assets-install use `relative` symlinks
2017-04-25 14:15:01 +02:00
f972af3f5b Make symfony-assets-install use relative symlinks
This facilitates packaging, when installing in a different work PREFIX
than the final install location.

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2017-04-22 21:45:30 +10:00
656395fde6 Merge pull request #3023 from mart-e/epub-notice-at-the-end
Add export notice at the end of the epub
2017-04-05 10:20:19 +02:00
1b70990b01 Add export notice at the end of the epub
The text "Produced by wallabag with PHPePub" is the first page of any epub.

On ebooks reader, it is common (e.g. kobo) to use the first page as the cover of
unread books, which makes it more difficult to differentiate the books.

Move the Notices chapter at the end of the book.
2017-04-05 09:24:48 +02:00
548e608870 Merge pull request #3017 from Kdecherf/local-image-alpha
Save alpha channel when downloading PNG images
2017-03-30 14:45:24 +02:00
7a3260ae9e Save alpha channel when downloading PNG images
Fixes #2805

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-03-29 21:58:29 +02:00
90f95027a8 Merge pull request #2985 from etiess/patch-2
Update paywall.rst (more details and clear cache)
2017-03-23 13:56:55 +01:00
7423ed4766 Merge pull request #2968 from chrido/master
remove language on html tag
2017-03-13 10:56:33 +01:00
3f5f303e7f Merge pull request #2971 from etiess/patch-3
Update paywall.rst (EN) with details + clear cache
2017-03-09 15:34:40 +01:00
cee28dc6d4 remove language on html-tag 2017-03-06 21:34:50 +01:00
5301d664d9 Update paywall.rst (EN) with details + clear cache 2017-02-23 08:54:33 +01:00
e316d4bd34 Update paywall.rst (more details and clear cache) 2017-02-22 11:49:45 +01:00
30 changed files with 1135 additions and 883 deletions

4
.gitignore vendored
View File

@ -51,3 +51,7 @@ bin
app/Resources/build/
!/src/Wallabag/CoreBundle/Resources/public
/src/Wallabag/CoreBundle/Resources/public/*
# Test-generated files
admin-export.json
specialexport.json

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ make release master /tmp wllbg-release prod
- [Create the new release on GitHub](https://github.com/wallabag/wallabag/releases/new). You have to upload on this page the package.
- Delete the `release-$LAST_WALLABAG_RELEASE` branch and close the pull request (**DO NOT MERGE IT**).
- Update the URL shortener (used on `wllbg.org` to generate links like `http://wllbg.org/latest-v2-package` or `http://wllbg.org/latest-v2`)
- Update the URL shortener (used on `wllbg.org` to generate links like `https://wllbg.org/latest-v2-package` or `http://wllbg.org/latest-v2`)
- Update [the downloads page](https://github.com/wallabag/wallabag.org/blob/master/content/pages/download.md) on the website (MD5 sum, release date)
- Update Dockerfile https://github.com/wallabag/docker (and create a new tag)
- Update wallabag.org website (downloads, releases and new blog post)

View File

@ -30,7 +30,7 @@ framework:
assets: ~
wallabag_core:
version: 2.2.2
version: 2.2.3
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
languages:
en: 'English'

View File

@ -84,7 +84,7 @@
"javibravo/simpleue": "^1.0",
"symfony/dom-crawler": "^3.1",
"friendsofsymfony/jsrouting-bundle": "^1.6",
"bdunogier/guzzle-site-authenticator": "dev-master"
"bdunogier/guzzle-site-authenticator": "1.0.0-beta1"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "~2.2",
@ -115,7 +115,7 @@
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "symlink",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
}

612
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -61,7 +61,7 @@ Lade das letzte Release von wallabag herunter:
.. code-block:: bash
wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
wget https://wllbg.org/latest-v2-package && tar xvf latest-v2-package
Du findest den `aktuellen MD5-Hash auf unserer Webseite <https://www.wallabag.org/pages/download-wallabag.html>`_.

View File

@ -6,12 +6,16 @@ wallabag can fetch articles from websites which use a paywall system.
Enable paywall authentication
-----------------------------
In internal settings, in the **Article** section, enable authentication for websites with paywall (with the value 1).
In internal settings, as a wallabag administrator, in the **Article** section, enable authentication for websites with paywall (with the value 1).
Configure credentials in wallabag
---------------------------------
Edit your ``app/config/parameters.yml`` file to edit credentials for each website with paywall. Here is an example for some french websites:
Edit your ``app/config/parameters.yml`` file to edit credentials for each website with paywall. For example, under Ubuntu:
``sudo -u www-data nano /var/www/html/wallabag/app/config/parameters.yml``
Here is an example for some french websites (be careful: don't use the "tab" key, only spaces):
.. code:: yaml
@ -28,7 +32,7 @@ Parsing configuration files
.. note::
Read `this part of the documentation <http://doc.wallabag.org/en/master/user/errors_during_fetching.html>`_ to understand the configuration files.
Read `this part of the documentation <http://doc.wallabag.org/en/master/user/errors_during_fetching.html>`_ to understand the configuration files, which are located under ``vendor/j0k3r/graby-site-config/``. For most of the websites, this file is already configured: the following instructions are only for the websites that are not configured yet.
Each parsing configuration file needs to be improved by adding ``requires_login``, ``login_uri``,
``login_username_field``, ``login_password_field`` and ``not_logged_in_xpath``.
@ -54,3 +58,8 @@ For example:
login_password_field: password
not_logged_in_xpath: //body[@class="not-logged-in"]
Last step: clear the cache
--------------------------
It's necessary to clear the wallabag cache with the following command (here under Ubuntu): ``sudo -u www-data php /var/www/html/wallabag/bin/console cache:clear -e=prod``

View File

@ -65,7 +65,7 @@ Download the last release of wallabag:
.. code-block:: bash
wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
wget https://wllbg.org/latest-v2-package && tar xvf latest-v2-package
You will find the `md5 hash of the latest package on our website <https://www.wallabag.org/pages/download-wallabag.html>`_.

View File

@ -6,12 +6,16 @@ wallabag peut récupérer le contenu des articles des sites qui utilisent un sys
Activer l'authentification pour les paywall
-------------------------------------------
Dans les paramètres internes, section **Article**, activez l'authentification pour les articles derrière un paywall (avec la valeur 1).
Dans les paramètres internes, en tant qu'administrateur de wallabag, section **Article**, activez l'authentification pour les articles derrière un paywall (avec la valeur 1).
Configurer les accès dans wallabag
----------------------------------
Éditez le fichier ``app/config/parameters.yml`` pour modifier les accès aux sites avec paywall. Voici un exemple pour certains sites :
Éditez le fichier ``app/config/parameters.yml`` pour modifier les accès aux sites avec paywall. Par exemple, sous Ubuntu :
``sudo -u www-data nano /var/www/html/wallabag/app/config/parameters.yml``
Voici un exemple pour certains sites (attention, ne pas utiliser la touche "tab", seulement des espaces) :
.. code:: yaml
@ -28,7 +32,7 @@ Fichiers de configuration pour parser les articles
.. note::
Lisez `cette documentation <http://doc.wallabag.org/fr/master/user/errors_during_fetching.html>`_ pour en savoir plus sur ces fichiers de configuration.
Lisez `cette documentation <http://doc.wallabag.org/fr/master/user/errors_during_fetching.html>`_ pour en savoir plus sur ces fichiers de configuration, qui se trouvent dans le répertoire ``vendor/j0k3r/graby-site-config/``. Pour la majorité des sites, ce fichier est déjà configuré : les instructions qui suivent concernent seulement les sites non encore configurés.
Chaque fichier de configuration doit être enrichi en ajoutant ``requires_login``, ``login_uri``,
``login_username_field``, ``login_password_field`` et ``not_logged_in_xpath``.
@ -54,3 +58,8 @@ Par exemple :
login_password_field: password
not_logged_in_xpath: //body[@class="not-logged-in"]
Dernière étape : nettoyer le cache
----------------------------------
Il est nécessaire de nettoyer le cache de wallabag avec la commande suivante (ici sous Ubuntu) : ``sudo -u www-data php /var/www/html/wallabag/bin/console cache:clear -e=prod``

View File

@ -61,7 +61,7 @@ Téléchargez la dernière version de wallabag :
.. code-block:: bash
wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
wget https://wllbg.org/latest-v2-package && tar xvf latest-v2-package
Vous trouverez `le hash md5 du dernier package sur notre site <https://www.wallabag.org/pages/download-wallabag.html>`_.

View File

@ -86,7 +86,7 @@ Eseguite questo comando per scaricare ed estrarre il pacchetto piú aggiornato:
.. code-block:: bash
wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
wget https://wllbg.org/latest-v2-package && tar xvf latest-v2-package
Troverete il `hash md5 del pacchetto piú aggiornato sul nostro sito <https://www.wallabag.org/pages/download-wallabag.html>`_.

View File

@ -78,7 +78,7 @@ Scaricate l'ultima versione di wallabag:
. code-block:: bash
wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
wget https://wllbg.org/latest-v2-package && tar xvf latest-v2-package
Troverete il `hash md5 dell'ultima versione del pacchetto sul nostro sito <https://www.wallabag.org/pages/download-wallabag.html>`_.

View File

@ -98,12 +98,13 @@ class EntryRestController extends WallabagRestController
$tags = $request->query->get('tags', '');
$since = $request->query->get('since', 0);
/** @var \Pagerfanta\Pagerfanta $pager */
$pager = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order, $since, $tags);
$pager->setCurrentPage($page);
$pager->setMaxPerPage($perPage);
$pager->setCurrentPage($page);
$pagerfantaFactory = new PagerfantaFactory('page', 'perPage');
$paginatedCollection = $pagerfantaFactory->createRepresentation(
@ -199,10 +200,19 @@ class EntryRestController extends WallabagRestController
$entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId());
if (false === $entry) {
$entry = $this->get('wallabag_core.content_proxy')->updateEntry(
new Entry($this->getUser()),
$url
);
$entry = new Entry($this->getUser());
try {
$entry = $this->get('wallabag_core.content_proxy')->updateEntry(
$entry,
$url
);
} catch (\Exception $e) {
$this->get('logger')->error('Error while saving an entry', [
'exception' => $e,
'entry' => $entry,
]);
$entry->setUrl($url);
}
}
if (!is_null($title)) {

View File

@ -16,7 +16,11 @@ class ClientType extends AbstractType
{
$builder
->add('name', TextType::class, ['label' => 'developer.client.form.name_label'])
->add('redirect_uris', UrlType::class, ['required' => false, 'label' => 'developer.client.form.redirect_uris_label'])
->add('redirect_uris', UrlType::class, [
'required' => false,
'label' => 'developer.client.form.redirect_uris_label',
'property_path' => 'redirectUris',
])
->add('save', SubmitType::class, ['label' => 'developer.client.form.save_label'])
;

View File

@ -39,9 +39,11 @@ class ConfigType extends AbstractType
])
->add('items_per_page', null, [
'label' => 'config.form_settings.items_per_page_label',
'property_path' => 'itemsPerPage',
])
->add('reading_speed', ChoiceType::class, [
'label' => 'config.form_settings.reading_speed.label',
'property_path' => 'readingSpeed',
'choices' => [
'config.form_settings.reading_speed.100_word' => '0.5',
'config.form_settings.reading_speed.200_word' => '1',
@ -51,6 +53,7 @@ class ConfigType extends AbstractType
])
->add('action_mark_as_read', ChoiceType::class, [
'label' => 'config.form_settings.action_mark_as_read.label',
'property_path' => 'actionMarkAsRead',
'choices' => [
'config.form_settings.action_mark_as_read.redirect_homepage' => Config::REDIRECT_TO_HOMEPAGE,
'config.form_settings.action_mark_as_read.redirect_current_page' => Config::REDIRECT_TO_CURRENT_PAGE,
@ -61,6 +64,7 @@ class ConfigType extends AbstractType
'label' => 'config.form_settings.language_label',
])
->add('pocket_consumer_key', null, [
'property_path' => 'pocketConsumerKey',
'label' => 'config.form_settings.pocket_consumer_key_label',
])
->add('save', SubmitType::class, [

View File

@ -21,6 +21,7 @@ class EditEntryType extends AbstractType
->add('is_public', CheckboxType::class, [
'required' => false,
'label' => 'entry.edit.is_public_label',
'property_path' => 'isPublic',
])
->add('url', TextType::class, [
'disabled' => true,

View File

@ -3,6 +3,7 @@
namespace Wallabag\CoreBundle\Form\Type;
use Doctrine\ORM\EntityRepository;
use Lexik\Bundle\FormFilterBundle\Filter\FilterOperands;
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType;
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType;
@ -33,7 +34,7 @@ class EntryFilterType extends AbstractType
$this->user = $tokenStorage->getToken() ? $tokenStorage->getToken()->getUser() : null;
if (null === $this->user || !is_object($this->user)) {
return null;
return;
}
}
@ -41,6 +42,14 @@ class EntryFilterType extends AbstractType
{
$builder
->add('readingTime', NumberRangeFilterType::class, [
'left_number_options' => [
'condition_operator' => FilterOperands::OPERATOR_GREATER_THAN_EQUAL,
'attr' => ['min' => 0],
],
'right_number_options' => [
'condition_operator' => FilterOperands::OPERATOR_LOWER_THAN_EQUAL,
'attr' => ['min' => 0],
],
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
$lower = $values['value']['left_number'][0];
$upper = $values['value']['right_number'][0];

View File

@ -14,6 +14,7 @@ class RssType extends AbstractType
$builder
->add('rss_limit', null, [
'label' => 'config.form_rss.rss_limit',
'property_path' => 'rssLimit',
])
->add('save', SubmitType::class, [
'label' => 'config.form.save',

View File

@ -144,6 +144,8 @@ class DownloadImages
$this->logger->debug('DownloadImages: Re-creating jpg');
break;
case 'png':
imagealphablending($im, false);
imagesavealpha($im, true);
imagepng($im, $localPath, ceil(self::REGENERATE_PICTURES_QUALITY / 100 * 9));
$this->logger->debug('DownloadImages: Re-creating png');
}

View File

@ -148,8 +148,6 @@ class EntriesExport
$book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png');
}
$book->addChapter('Notices', 'Cover2.html', $content_start.$this->getExportInformation('PHPePub').$bookEnd);
$book->buildTOC();
/*
@ -170,6 +168,8 @@ class EntriesExport
$book->addChapter($entry->getTitle(), htmlspecialchars($filename).'.html', $chapter, true, EPub::EXTERNAL_REF_ADD);
}
$book->addChapter('Notices', 'Cover2.html', $content_start.$this->getExportInformation('PHPePub').$bookEnd);
return Response::create(
$book->getBook(),
200,

View File

@ -359,7 +359,7 @@ quickstart:
developer:
title: 'Developers'
description: 'We also thought to the developers: Docker, API, translations, etc.'
create_application: 'Create your third application'
create_application: 'Create your third-party application'
use_docker: 'Use Docker to install wallabag'
docs:
title: 'Full documentation'

View File

@ -3,7 +3,7 @@
<!--[if lte IE 7]><html class="no-js ie7 ie67 ie678" lang="en"><![endif]-->
<!--[if IE 8]><html class="no-js ie8 ie678" lang="en"><![endif]-->
<!--[if gt IE 8]><html class="no-js" lang="en"><![endif]-->
<html lang="fr">
<html>
<head>
{% block head %}
<meta name="viewport" content="initial-scale=1.0">

View File

@ -14,7 +14,7 @@
<ul>
<li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/developer/api.html">{{ 'developer.full_documentation'|trans }}</a></li>
<li><a href="https://doc.wallabag.org/en/developer/api/readme.html">{{ 'developer.full_documentation'|trans }}</a></li>
<li><a href="{{ path('nelmio_api_doc_index') }}">{{ 'developer.list_methods'|trans }}</a></li>
</ul>

View File

@ -34,9 +34,10 @@
<div id="set2" class="col s12">
<dl>
<dt>{{ 'about.getting_help.documentation'|trans }}</dt>
<dd><a href="http://doc.wallabag.org/en/master/">english</a></dd>
<dd><a href="http://doc.wallabag.org/fr/master/">français</a></dd>
<dd><a href="http://doc.wallabag.org/de/master/">deutsch</a></dd>
<dd><a href="https://doc.wallabag.org/en/">english</a></dd>
<dd><a href="https://doc.wallabag.org/fr/">français</a></dd>
<dd><a href="https://doc.wallabag.org/de/">deutsch</a></dd>
<dd><a href="https://doc.wallabag.org/it/">italiano</a></dd>
<dt>{{ 'about.getting_help.bug_reports'|trans }}</dt>
<dd>{{ 'about.getting_help.support'|trans|raw }}</dd>
@ -46,7 +47,7 @@
<div id="set3" class="col s12">
<dl>
<dt>{{ 'about.helping.description'|trans }}</dt>
<dd>{{ 'about.helping.by_contributing_2'|trans }} <a href="https://github.com/wallabag/wallabag/issues/1254">{{ 'about.helping.by_contributing'|trans }}</a></dd>
<dd>{{ 'about.helping.by_contributing'|trans }} <a href="https://github.com/wallabag/wallabag/issues/1254">{{ 'about.helping.by_contributing_2'|trans }}</a></dd>
<dd><a href="{{ paypal_url }}">{{ 'about.helping.by_paypal'|trans }}</a></dd>
</dl>
</div>
@ -106,8 +107,8 @@
<tr><td>hoa/zformat</td><td>BSD-3-Clause</td></tr>
<tr><td>htmlawed/htmlawed</td><td>GPL-2.0+ or LGPL-3.0</td></tr>
<tr><td>incenteev/composer-parameter-handler</td><td>MIT</td></tr>
<tr><td>j0k3r/graby</td><td>AGPL-3.0</td></tr>
<tr><td>j0k3r/graby-site-config</td><td>AGPL-3.0</td></tr>
<tr><td>j0k3r/graby</td><td>MIT</td></tr>
<tr><td>j0k3r/graby-site-config</td><td>Public domain</td></tr>
<tr><td>j0k3r/php-readability</td><td>Apache-2.0</td></tr>
<tr><td>j0k3r/safecurl</td><td>MIT</td></tr>
<tr><td>jdorn/sql-formatter</td><td>MIT</td></tr>

View File

@ -69,8 +69,8 @@
<div class="card-action">
<ul>
<li><a href="{{ path('developer') }}">{{ 'quickstart.developer.create_application'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/developer/docker.html">{{ 'quickstart.developer.use_docker'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/index.html#dev-docs">{{ 'quickstart.more'|trans }}</a></li>
<li><a href="https://doc.wallabag.org/en/developer/docker.html">{{ 'quickstart.developer.use_docker'|trans }}</a></li>
<li><a href="https://doc.wallabag.org/">{{ 'quickstart.more'|trans }}</a></li>
</ul>
</div>
</div>
@ -84,9 +84,9 @@
</div>
<div class="card-action">
<ul>
<li><a href="http://doc.wallabag.org/en/master/user/annotations.html">{{ 'quickstart.docs.annotate'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/download_articles.html">{{ 'quickstart.docs.export'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/">{{ 'quickstart.docs.all_docs'|trans }}</a></li>
<li><a href="https://doc.wallabag.org/en/user/articles/annotations.html">{{ 'quickstart.docs.annotate'|trans }}</a></li>
<li><a href="https://doc.wallabag.org/en/user/articles/download.html">{{ 'quickstart.docs.export'|trans }}</a></li>
<li><a href="https://doc.wallabag.org/">{{ 'quickstart.docs.all_docs'|trans }}</a></li>
</ul>
</div>
</div>

View File

@ -5,7 +5,7 @@
<div class="card-content">
{% if error %}
<script>Materialize.toast('{{ error.message }}', 4000)</script>
<script>Materialize.toast('{{ error.messageKey|trans(error.messageData, 'security') }}', 4000)</script>
{% endif %}
{% for flashMessage in app.session.flashbag.get('notice') %}

View File

@ -4,6 +4,7 @@ namespace Tests\Wallabag\ApiBundle\Controller;
use Tests\Wallabag\ApiBundle\WallabagApiTestCase;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\CoreBundle\Helper\ContentProxy;
class EntryRestControllerTest extends WallabagApiTestCase
{
@ -156,6 +157,22 @@ class EntryRestControllerTest extends WallabagApiTestCase
$this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type'));
}
public function testGetEntriesOnPageTwo()
{
$this->client->request('GET', '/api/entries', [
'page' => 2,
'perPage' => 2,
]);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThanOrEqual(0, $content['total']);
$this->assertEquals(2, $content['page']);
$this->assertEquals(2, $content['limit']);
}
public function testGetStarredEntries()
{
$this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated']);
@ -359,6 +376,39 @@ class EntryRestControllerTest extends WallabagApiTestCase
$this->assertCount(2, $content['tags']);
}
public function testPostEntryWhenFetchContentFails()
{
/** @var \Symfony\Component\DependencyInjection\Container $container */
$container = $this->client->getContainer();
$contentProxy = $this->getMockBuilder(ContentProxy::class)
->disableOriginalConstructor()
->setMethods(['updateEntry'])
->getMock();
$contentProxy->expects($this->any())
->method('updateEntry')
->willThrowException(new \Exception('Test Fetch content fails'));
$container->set('wallabag_core.content_proxy', $contentProxy);
try {
$this->client->request('POST', '/api/entries.json', [
'url' => 'http://www.example.com/',
]);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThan(0, $content['id']);
$this->assertEquals('http://www.example.com/', $content['url']);
} finally {
// Remove the created entry to avoid side effects on other tests
if (isset($content['id'])) {
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
$entry = $em->getReference('WallabagCoreBundle:Entry', $content['id']);
$em->remove($entry);
$em->flush();
}
}
}
public function testPostArchivedAndStarredEntry()
{
$this->client->request('POST', '/api/entries.json', [

View File

@ -591,6 +591,26 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertCount(1, $crawler->filter('div[class=entry]'));
}
public function testFilterOnReadingTimeWithNegativeValue()
{
$this->logInAs('admin');
$client = $this->getClient();
$crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = [
'entry_filter[readingTime][right_number]' => -22,
'entry_filter[readingTime][left_number]' => -22,
];
$crawler = $client->submit($form, $data);
// forcing negative value results in no entry displayed
$this->assertCount(0, $crawler->filter('div[class=entry]'));
}
public function testFilterOnReadingTimeOnlyUpper()
{
$this->logInAs('admin');

View File

@ -633,12 +633,6 @@ class SymfonyRequirements extends RequirementCollection
'Install and enable the <strong>mbstring</strong> extension.'
);
$this->addRecommendation(
function_exists('iconv'),
'iconv() should be available',
'Install and enable the <strong>iconv</strong> extension.'
);
$this->addRecommendation(
function_exists('utf8_decode'),
'utf8_decode() should be available',