Symfony 4 Sonata User Bundle Installation - sonata-user-bundle

I followed all instructions from installation guide but still
have this error during installation of Sonata User Bundle on Symfony 4 application:
Column name `id` referenced for relation from Application\Sonata\UserBundle\Entity\User towards Sonata\UserBundle\Entity\BaseGroup does not exist.
My config is totally same as in installation guide.
Didn't find any solutions on stackoverflow or anywhere else.

Finally I found the solution, but it took some time, so I want to post it here for everyone who encounter this problem.
Adding this code to config (e.g. sonata_core.yaml):
sonata_user:
class:
user: Application\Sonata\UserBundle\Entity\User
group: Application\Sonata\UserBundle\Entity\Group
and changing values of user_class and group_class in config (e.g. fos_user.yaml) solves problem:
fos_user:
db_driver: orm
firewall_name: main
user_class: Application\Sonata\UserBundle\Entity\User
from_email:
address: noreply#example.com
sender_name: John Doe
group:
group_class: Application\Sonata\UserBundle\Entity\Group
group_manager: sonata.user.orm.group_manager
service:
user_manager: sonata.user.orm.user_manager
There is nothing about this in installation guide, I found it in advanced configuration chapter.
Hope this helps someone.

Related

Angular Build - Uncaught TypeError: Cannot read property 'id' of undefined

I have managed to build my angular app out as a dev build. I haven't done it as a production build yet as it gives me a few errors and i just need to test the dev build.
The dev build process goes fine, no errors or anything. I then use the files from the dist folder in a nginx docker container to host the files.
The problem is nothing is displayed but a white page and in the console i get an error saying 'Uncaught TypeError: Cannot read property 'id' of undefined'. The full message below doesn't seem to point to anything i have written and i've spent several hours searching online but can't find anything on this problem.
I've tried a few different things such as running 'npx ivy-ngcc' which i read manually compiles some stuff. Is there anyway i can get more details on the error to see if it's something i have done?
UPDATE
So i have restored the line that i commented out in main.ts as mentioned in the comments below. I have also tried 'ng build --aot' as suggested which presents me with a series of errors that all seem to relate to devextreme components that are used. I find this strange as i started the project with the devextreme angular starter project from github.
i get messages such as:
'dx-scroll-view is not a valid HTML element'
'node_modules/devextreme-angular/ui/drawer.d.ts - error: appears in
the NgModule.imports of SideNavOuterToolbarModule, but could not be resolved to an NgModule class'
If you go in the devtools and click on Sources, "Don't pause on exceptions" and check "Pause on caught expecptions" and continue until you get the "id error" you will find what module the error is thrown. In my case was a third party library called 'ngx-card/ngx-card' and it's module was the cause of the error (CardModule). Hope this will help find at least the cause of the error
I managed to solve the problem by disabling ivy in the angular compilation options. As soon as i did that it worked building both dev and production versions and is now working perfectly within Nginx.
Thanks to everyone who offered help :)
In tsconfig.json of your Angular project, put this to disable Ivy, the new Angular template engine
{
...
"angularCompilerOptions": {
"enableIvy": false
}
}
Typically, if it's not something that you've written, it tends to be an issue w/ your implementation - i.e. "Visiting a food vendor and ordering a food item they don't provide".
I know it's not a specific answer, but ensuring that you have appropriately configured things in your app.module would be a good first step. Perhaps attempting to build w/ AOT will also give you some more verbose failures that stem from attempting to build out.
Hopefully this helps another poor soul.
To anyone using devextreme, make sure you update your version to at least 19.2.5
https://github.com/DevExpress/devextreme-angular/issues/975#issuecomment-580172291
Starting with version 19.2.5 we support the IVY compiler.
I had the same issue and fixed it by changing from
loadChildren: './app/page/account/account.module#AccountModule'
to
loadChildren: () =>
import('./app/page/account/account.module').then(
(m) => m.AccountModule
)
in app-router.module.ts
The root cause of your error is very likely to be a module that you needed to load explicitly but didn't, or a circular reference in your own modules. Rodrigo has a good answer but to be more specific, you need to find the registerNgModuleType function in Angular's core.js and set a conditional breakpoint on the first line. The condition should be !ngModuleType || !ngModuleType.ɵmod. (You can set a conditional breakpoint in most modern browsers by right-clicking the line number.)
Once you've paused execution just before the exception happens, you can look at the value of ngModuleType if it's not undefined, or walk up a frame or two in the scope and see what the value of imports was.
For me, this issue occurred while using Storybook.
The reason it happened was because of the way I was precompiling the node modules. I was doing:
Incorrect
ngcc --properties es2015 browser module main --first-only
Correct
ngcc
Using this approach fixed it

holotoolkit2017: Cannot find the HandsManager and GestureManager scripts

I added in the unity2017.1 holotoolkit2017, but I can't find HandsManager and GesturesManager scripts.
I tried to include the scripts according to the official tutorial, but the error persists.
A quick google search revealed that version v1.2017.1.0 moved parts of these two scripts:
GestureManager.cs moved hand related interactions into HandsManager.cs
Their current location is
Assets/HoloToolkit/Input/Scripts/
Hope this is of some help.

Symfony3 customizing error pages (404, 403...)

I don't know what is wrong but I couldn't override the error pages as describe in the documentation by simply create the related file at app/Resources/TwigBundle/views/Exception/error.404.html.twig or app/Resources/TwigBundle/views/Exception/error.403.html.twig and so on...
Notice that I also clean the cache as well before check it: bin/console cache:clear --env=prod. I'm using Symfony 3.0.6
the twig file name should be:
error404.html.twig
not:
error.404.html.twig
Let me know if you still have problems. This should work, because I've used it.

What's the correct way to download webrtc source code?

I'm trying to follow the instructions outlined here:
http://www.webrtc.org/native-code/development#TOC-Before-you-start;
but "fetch webrtc" fails with a message that implies a file (src/buildtools/linux32/gn.sha1) is not found. See this post for more detail on the error message:
https://groups.google.com/forum/#!topic/discuss-webrtc/Dt-GRIlLVe4
I've walked through installation of all the "prerequisite software" as described on the above page, but consistently hit the same error. I'm doing this from a Ubuntu 14.04 LTS machine, any thoughts on what I might be doing wrong?
gn is a replacement for gyp to generate Ninja files. I don't think it's required yet (gn is a work-in-progress), but that's likely what you're missing. You could comment out gn from the DEPS and see if things work.
Answering my own question here...
It appears that the problem is related to the fact that I am behind a proxy
and the --no_auth option is used (in depot_tools) when the download_from_google_storage.py script is called.
After reading this post: https://github.com/GoogleCloudPlatform/gsutil/issues/241
I modified my copy of "download_from_google_storage.py" so that the --no_auth option would have no affect. I also created a ~/.boto file with three lines:
[Boto]
proxy = my.proxy.goes.here.com
proxy_port = PROXY_PORT_NUMBER
Then I re-ran "fetch webrtc" and it completed successfully in about 75 minutes.
Go figure...

iPhone SQLite encryption with SQLCipher facing errors

I am trying to learn about the encryption of DB at application level using this tutorial. But I am getting an error that says
sqlcipher/sqlite3.c:11033:25: error: openssl/evp.h: No such file or directory
sqlcipher/sqlite3.c:11034:26: error: openssl/rand.h: No such file or directory
sqlite3.c:11035:26: error: openssl/hmac.h: No such file or directory
and due these there are around 93 more errors in the build process. I have strictly followed the tutorial but I am not able to get rid of those errors.
I have added the path of the source code as instructed in the tutorials but still the problem persists. The screenshot could be seen here
I had the same problem, in my case it was caused by a space in my OPENSSL_SRC path. Enclosing the value of OPENSSL_SRC in double-quotes fixed the problem.
The error messages you are seeing indicate that the compiler can't find the OpenSSL headers included in the SQLCipher code. The most likely problem is that you didn't add the OpenSSL headers to your include path when setting up your project. Perhaps you missed this step in the tutorial: "Look for the “Header Search Paths” setting and add references to $(SQLCIPHER_SRC) and $(OPENSSL_SRC). Check “recursive” on both."
As an aside, the information on that MO article is dated. In the future you can refer to this updated tutorial on the SQLCipher website: http://sqlcipher.net/documentation/ios
After long time i'm not sure whether you fixed this issue or not anyway to fix this do as follows:
In OPENSSL_SRC change destination from "/openssl-1.0.0d" to "/openssl-1.0.0d/include".
thatz it..it has to work.

Resources