четверг, 26 августа 2021 г.

[Symfony] Cannot login at Test environment - fix (in Behat)

When you trying to login in Test env, and it does not show any error (you was returned on login form again), and you does not have anything in logs, except Guard authenticator does not support the request. {"firewall_key":"main","authenticator":"App\\Security\\AppAuthenticator"}, you can try this.

 I removed lines:

 session:

        storage_id: session.storage.mock_file

in config/packages/test/framework.yaml and it worked

вторник, 10 августа 2021 г.

How to create CollectionType with empty one element

 Add 'data' => [''] (not 'empty_data') to the Collection type form configuration.

понедельник, 9 августа 2021 г.

Swedbank Latvia apk download for Huawei users

 Download link here (no viruses, I am also using this version):

https://cloud.mail.ru/public/MzmP/dHKuUHvqc

downloaded via apps.evozi.com.

If you don't have Google Play or using Huawei phones (like P40 lite), you can download Swedbank Latvia android app from here

четверг, 8 июля 2021 г.

[Sylius] GridHelper::renderGrid() must be an instance of Sylius\Component\Grid\View\GridView, instance of Pagerfanta\Pagerfanta - how to fix

 It means you forgot to put `grid: gridname` into your route configuration. For example:

admin_user_index:

    path: /users

    defaults:

        _controller: app.controller.user::indexAction

        _sylius:

            template: "@AdminBundle/grid/index.html.twig"

            grid: admin_user

воскресенье, 4 июля 2021 г.

[Symfony] how to modify data_class object setting logic

 When you need extra manipulations to object data population in form (for example, you need to resolve whether is entered user email is already registered and put existing user object or it needs to create a new user), you might want to set data_class with closure, but there isn't such option.

The right way is to use https://symfony.com/doc/4.4/form/data_mappers.html Data Mappers

воскресенье, 27 июня 2021 г.

how to load BazingaJsTranslationBundle without ajax requests (+ inside Vue components)

  1. Install it as in bundle readme.md
  2. run `php bin/console bazinga:js-translation:dump public/js --format=js`
  3. add in your main template tag: <html lang="{{ app.request.locale|split('_')[0] }}">
  4. add in your js file:
    global.Translator = require('../public/bundles/bazingajstranslation/js/translator.min');
    require('../public/js/translations/messages/ru.js');
  5. if you need also access Translator via Vue, add it in your Vue initialization file:
    Vue.prototype.$t = Translator;
    And use it in your template like this: 
    {{ $t.trans('common.save') }}

вторник, 15 июня 2021 г.

[linux] how to optimize performance with browser hardware acceleration

I had performance issues mostly because browser slowed down everything. I just enabled flags "Override software rendering list" and "GPU rasterization" in chrome://flags and work become much better. I also works on Chrome/Chromium and Opera.

Works well on MSI 2pe leopard