понедельник, 30 июля 2018 г.

FOSRestBundle invalid form doesn't use ExceptionWrapper

If your FOSRestBundle response doesn't have normal type, (for example, as below):

{
    "form": {
        "children": {
            "currency": {},
            "limit": {
                "errors": [
                    "This value should be greater than or equal to 0."                ]
            },
            "": {},
            "name": {}
        }
    },
    "errors": []
},
As we see, there are no 'code' and 'message' keys, so FOSRestBundle type is wrong. To fix it, use
$view->getContext()->setAttribute('status_code', Response::HTTP_BAD_REQUEST);
for your $view object.

среда, 4 июля 2018 г.

Notice: undefined index id after changing MongoDB id to string

after using a php annotation @Mongo\Id(strategy="NONE") you can receive Notice: undefined index id PHP error, for this just run symfony cache:clear command.

вторник, 15 мая 2018 г.

Sulu /admin/translations/sulu.en.json?v=develop error fix

Be sure you haven't deleted sulu.en.json in project web/admin, and there anything will not be deleted (for example as Vagrant's Rsync do that). After this restore translations with php bin/console sulu:translate:export .

понедельник, 7 мая 2018 г.

Symfony FileType doesnt append file

If you cannot receive file on form submit (file field left null), be sure your {{ form_row(file) }} is inside {{ form-start(form) }} and {{ form_end(form) }}, and also check is this scope closed properly, check this in Devtools.

суббота, 5 мая 2018 г.

How to fix Sulu page previews

thanks to this commit, you can update Sulu from 1.6.17 to 1.6.18 and receive this fix.

понедельник, 30 апреля 2018 г.

How to fix "the system cannot find the file specified. (code: 2)" and "unable to evaluate symlinks in Dockerfile"

If you receive "unable to evaluate symlinks in Dockerfile path" or "windows named pipe error: the system cannot find the file specified. (code: 2)" errors on Docker for Windows, enable Hyper-V in "turn on or off windows features" app and restart the computer.

среда, 25 апреля 2018 г.

how to fix Liip Imagine Bundle gets image only after browser page refresh

Be sure you didn't left somewhere dump() function at `resolve` route. It prevents of creating correct 301 response. Symfony in Profiler write it is 301, but actually in Chrome Devtools it is 200 because of dump() php function.