SilverStripe 4 with fluent: "Table 'ss4_project.Member_Localised' doesn't exist" - silverstripe

I've got fresh project using SilverStripe 4.8 and fluent 5.0.0. I've added an extension to the Member and the fluent extension with fields to translate:
SilverStripe\Security\Member:
extensions:
- MemberExtension
- TractorCow\Fluent\Extension\FluentExtension
translate:
- ShortDesc
- Description
Seems pretty standard, but I get Table 'ss4_project.Member_Localised' doesn't exist during dev/build. I've tried without the translate fields as well as in a different configuration loaded after the member extension. No luck.
I have the feeling I'm missing something obvious.
Any clues are appreciated.

On Github, I've got the following solution:
Security::force_database_is_ready(false); // only during dev/build
to switch of the protection for core table temporary.
For details see https://github.com/tractorcow-farm/silverstripe-fluent/issues/725

Related

Dump Documentation [NelmioApiDocBundle] v3.0

I'm using the NelmioApiDocBundle (v3.0) in my symfony 4 project and I want to dump the documentation of my Api project.
I see it's possible to do with older version of NelmioApiDocBundle with this command :
php bin/console api:swagger:dump destination_folder
but I got this error :
There are no commands defined in the "api:swagger" namespace
I don't know if it's still posible to dump the documentation with the new version of NelmioApiDocBundle
Seeing NelmioApiDocBundle makes me almost sure you are using FOSRestBundle, if you are I'd change to api-platform, you make ask why? First of all you get the API doc by default on route /api (no matter what format etc you always get full doc) second of all the bundle is easy to configure even if you need some custom funcionality like access to property per operation and even depending on role more here I've tried FOSRestBundle on Symfony 5.0 but it couldnt provide with the funcionality and configuration I desired and then I found out about the API platform. In case I missed your desired answer let me know in the comment and I'll provide the answer as good as I can

PhpStorm does not recognize Doctrine's default entity manager

I have the following code :
$repo = $this->get('doctrine.orm.default_entity_manager')
->getRepository('Acme:Foo');
For the record, the code is working correctly since I can use $repo, its methods and the resulting entities without a problem.
However PhpStorm highlights the 'doctrine.orm.default_entity_manager' string and gives me the following error:
Missing service
I get the same error in my services files when referencing that particular service. Following that, obviously, autocomplete does not work. I can use the following workaround, of course:
/** #var \Doctrine\ORM\EntityManager $em */
$em = $this->get('doctrine.orm.default_entity_manager');
$em->getRepository('Acme:Foo');
This way I still get a warning but autocompletion works properly. However, I'd rather keep my code clean from this kind of annotation as much as possible, plus I'm almost sure there's an easy fix for that. I have of course cleared my cache multiple times.
How can I fix this?
EDIT: I need to mention I'm using the Symfony2 plugin.
In PhpStorm i accidentally mark directory "var" as "Excluded"
So my "fix" was easy:
right click on directory, "Mark Directory as" -> "Cancel Exclusion"
Using latest stable PHPStorm and Symfony plugin, I had problem with some services because my var/cache/ was in /dev/shm in my vagrant box (while PHPStorm is running on windows).
When I have all files var/cache it should be working well.
I think that it needs var/cache/dev/appDevDebugProjectContainer.xml to be generated, up to date, and accessible.
We did the following to avoid issues like you're describing:
In our services.yml I have defined:
entity_manager:
alias: doctrine.orm.entity_manager
The problem was that obviously the Symfony 2 plugin doesn't recognize some 'standard' services which are usually available.
And now using
$this->get('entity_manager');
isn't showing any issue with an activated Symfony 2 plugin.
We use a very similar approach for other 'general services' like Logger, Mailer etc.
As said in comments. Check in Settings -> Plugins Search Symfony Plugin
Then Install it.

Reference docs for Azure Resource Templates

I am looking for reference docs for the Azure Resource Manager JSON templates. Does anyone know if there is reference material for these templates?
There is general reference for required parameters etc like at Create a template deployment.
I am basically looking for the full availability so I can correspond setup on the portal to the JSON template. Also availability of features with apiVersion releases. I remember there being a MSDN documentation for the changelog with api version releases but cannot find it now.
If you create a VM with the desired settings, extensions etc then you can view their json template via https://resources.azure.com/
This will give some visibility into the Classic* templates.
All of the ARM templates can be found on GitHub here: https://github.com/Azure/azure-resource-manager-schemas.
It includes preview templates and should provide all the information you're after to determine which features are present in which apiVersion release.
Microsoft has finally created what I was looking for 🎉: full documentation is now available at https://learn.microsoft.com/en-au/azure/templates/
After some digging I managed to get the following list of schemas:
http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json
http://schema.management.azure.com/schemas/2014-06-01/Microsoft.Web.json
http://schema.management.azure.com/schemas/2014-04-01-preview/Microsoft.Sql.json
http://schema.management.azure.com/schemas/2014-04-01/Microsoft.Insights.json
http://schema.management.azure.com/schemas/2014-02-26/microsoft.visualstudio.json
http://schema.management.azure.com/schemas/2014-04-01-preview/Microsoft.Cache.json
http://schema.management.azure.com/schemas/2014-04-01/Microsoft.BizTalkServices.json
http://schema.management.azure.com/schemas/2014-08-01/Microsoft.Scheduler.json
http://schema.management.azure.com/schemas/2014-04-01/SuccessBricks.ClearDB.json
http://schema.management.azure.com/schemas/2015-01-01/Microsoft.Resources.json
http://schema.management.azure.com/schemas/2015-01-01/Microsoft.Authorization.json
http://schema.management.azure.com/schemas/2014-10-01-preview/Microsoft.Authorization.json
This list notably excludes:
Microsoft.ClassicCompute
Microsoft.ClassicStorage
Microsoft.ClassicNetwork
So I guess we're left to figure stuff out from the templates on those
To my mind we can dig that way:
open the azure-resource-manager schemas
Look at the main form below:
If you open properties, you will find the format that we need to fill:
open parameters and look at the structure:
$ref: #/definitions/parameter invite us to look at the same documents in definitions.parameters where you will find some documentation (like value you can use etc):
finally, if you look to properties.resources, you will find a list of url like:
{ "$ref": "http://schema.management.azure.com/schemas/2015-07-01-preview/Microsoft.ServerManagement.json#/resourceDefinitions/node" }
{ "$ref": "http://schema.management.azure.com/schemas/2015-07-01-preview/Microsoft.ServerManagement.json#/resourceDefinitions/gateway" }
if you open one of these url, you will find the JSON format you are looking for (here is a part of the first one):
There is not much available...
Azure Resource Manager Template Language
https://azure.microsoft.com/en-us/documentation/articles/resource-group-authoring-templates/
And then you can look at the different json.schemas that I have managed to find
deploymentTemplate
http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json
visualstudio
http://schema.management.azure.com/schemas/2014-02-26/microsoft.visualstudio.json
Sql
http://schema.management.azure.com/schemas/2014-06-01/2014-04-01-preview/Microsoft.Sql.json
Web
http://schema.management.azure.com/schemas/2014-06-01/Microsoft.Web.json
deploymentParameters
http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentParameters.json
If you use Visual Studio to edit the json-template file you get intellisense (sometimes) which help a bit. But the lack of documentation is really annoying...for example I have no clue if the schemas listed above are the most recent or not, and I have no idea where to find which one is the most resent.
Edit:
I came across the list of additions and changes to the Service Management APIs. Seems to be a bit outdated, 2015-01-01 is the current version and it's not there.
Edit2:
With the Iaas updates at Build 2015, there seems to also be a lot of Azure Quickstart Templates. At minimum, they have the particular cases I was looking for with storage accounts.

How to register simple things entity Audit extension in symfony2

I am trying to use simple things entity audit bundle in my application, but couldnt figure out the way to get this right. Please find the steps i am trying below,
1) Installed simple things bundle into vendor directory via composer file
2) Not sure where to autoload as given in the read me file
3) Added the setting of audited entities in config.yml
simple_things_entity_audit:
audited_entities:
- AcmeDemoBundle\Entity\Vendor
- AcmeDemoBundle\Entity\Employee
But Not sure how to register them as extension in doctrine configuration. I am very new to this bundle. Any help here would be really appreciated.
Use Acme\DemoBundle\Entity\Vendor instead of AcmeDemoBundle\Entity\Vendor

How can I tell if Netbeans 7.3 and Symfony2 is working properly?

I have recently followed the common advice found on the internet on how to install Symfony2 in Netbeans 7.3 by pointing the configuration to the Symfony2 standard edition zip file.
Now I'm following the book on the Symfony website to create the HelloBundle demo, and I'm noticing some inconsistencies.
First, when running a Symfony command in Netbeans, the generate bundle does not work as the book says it should. It forces me to use the --dir option. Here are the parameters I had to add:
--namespace=Acme/HelloBundle --format=yml --dir=src
Secondly, I see the routing file that was created, but the route parameters are different than what the book says. First the term "Pattern" is used instead of "Path." Further searching indicates that "Pattern" is an obsolete term and that "Path" is preferred now. If this is the case, then why is "Pattern" showing up in my files if I'm using the most current version of the framework (2.3.1)? Also, my routing file has the word "Default" in it while the book has "Hello." Here is a copy of the output.
acme_hello_homepage:
pattern: /hello/{name}
defaults: { _controller: AcmeHelloBundle:Default:index }
Finally, the book is unclear as to whether or not creating the bundle also automatically creates the controller files. Is this the case? I do not have "HelloController.php" file the books says I should be editing.
I'm new to Symfony, but this feels a little off. If that's the case how do I configure it to work as it should?
I'm using Netbeans as IDE for my symfony 2.x projects, i can't tell what's the problem with your Netbeans configuration, but here's a guide that can help setting-up things :)
http://software-talk.org/blog/2012/06/symfony2-tutorial-netbeans-and-symfony2-setting-everything-up/
Hope it helps.

Resources