forked from wallabag/wallabag
Fix recent update
- some missing url parameters from WallabagRestController & EntryController - use a service for `EntryFilterType` to use fully qualified name instead (so changing class signature) - update ImportBundle (url & form)
This commit is contained in:
@ -234,7 +234,7 @@ class EntryController extends Controller
|
||||
throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
|
||||
}
|
||||
|
||||
$form = $this->createForm(new EntryFilterType($repository, $this->getUser()));
|
||||
$form = $this->createForm(EntryFilterType::class);
|
||||
|
||||
if ($request->query->has($form->getName())) {
|
||||
// manually bind values from the request
|
||||
|
||||
@ -12,7 +12,7 @@ use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
|
||||
|
||||
class EntryFilterType extends AbstractType
|
||||
{
|
||||
@ -23,12 +23,12 @@ class EntryFilterType extends AbstractType
|
||||
* Repository & user are used to get a list of language entries for this user.
|
||||
*
|
||||
* @param EntityRepository $entryRepository
|
||||
* @param User $user
|
||||
* @param TokenStorage $token
|
||||
*/
|
||||
public function __construct(EntityRepository $entryRepository, User $user)
|
||||
public function __construct(EntityRepository $entryRepository, TokenStorage $token)
|
||||
{
|
||||
$this->repository = $entryRepository;
|
||||
$this->user = $user;
|
||||
$this->user = $token->getToken()->getUser();
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
@ -54,13 +54,13 @@ class EntryFilterType extends AbstractType
|
||||
)
|
||||
->add('domainName', TextFilterType::class, array(
|
||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||
$value = $values['value'];
|
||||
if (strlen($value) <= 2 || empty($value)) {
|
||||
return;
|
||||
}
|
||||
$expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%'));
|
||||
$value = $values['value'];
|
||||
if (strlen($value) <= 2 || empty($value)) {
|
||||
return;
|
||||
}
|
||||
$expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%'));
|
||||
|
||||
return $filterQuery->createCondition($expression);
|
||||
return $filterQuery->createCondition($expression);
|
||||
},
|
||||
))
|
||||
->add('isArchived', CheckboxFilterType::class)
|
||||
|
||||
@ -26,7 +26,7 @@ class UserInformationType extends AbstractType
|
||||
|
||||
public function getParent()
|
||||
{
|
||||
return 'fos_user_registration';
|
||||
return 'FOS\UserBundle\Form\Type\RegistrationFormType';
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
|
||||
@ -14,6 +14,14 @@ services:
|
||||
tags:
|
||||
- { name: form.type }
|
||||
|
||||
wallabag_core.filter.type.entry:
|
||||
class: Wallabag\CoreBundle\Filter\EntryFilterType
|
||||
arguments:
|
||||
- "@wallabag_core.entry_repository"
|
||||
- "@security.token_storage"
|
||||
tags:
|
||||
- { name: form.type }
|
||||
|
||||
wallabag_core.param_converter.username_rsstoken_converter:
|
||||
class: Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter
|
||||
tags:
|
||||
|
||||
Reference in New Issue
Block a user