Nelmio/Alice 2.x Symfony 3 , Loading Related Fixtures in Different Bundles - symfony

If there's already answer to my question then sorry and please point me in the right direction because I can't find anything.
Let's say I have two Bundles. Each bundle has fixures.yml file and loader file.
Loaders and fixtures are working fine when they are not depending on each other.
However when I am referencing fixtureA from fixtureB I get duplicated record in database.
E.g:
user_{1..10}:
email (unique): '<firstName()>+<randomNumber()>#gmail.com'
plainPassword: 'secret'
story_{1..10}:
user: "#user_<current()>"
title: '<word>'
When they are in separated files - duplicated row. When they are in the same file everything is ok.
Why it's being loaded twice?
I even tried this:
$objects = Fixtures::load(__DIR__ . '/fixtures.yml', $manager, ['persist_once'=>true]);
No luck.
Evey time I am trying to use user object in story fixtures alice tries to save it into db again.
Best Regards,
Robert

I did a little research and talked to people - it looks like it's a possible bug. You can learn more here:
Nelmio/Alice 2.x Duplicated Row
Also I would like to share my work around:
I wanted to keep things separated and clean. Instead of keeping all fixtures in one file in one bundle you can move it to App/DataFixtures/ORM directory. However Symfony will not look for fixtures in this directory. You can:
add path to the fixtures in console command:
doctrine:fixtures:load --fixtures=/var/www/story/app/DataFixtures/ORM
create alias for above solution
override DoctrineFixturesBundle - how to do this
I hope this will help if you have similar issue.

Related

How to add new column to exitsting table symfony - orocommerce

I'm working on an orocommerce project, and it use vendor/oro/bundles/bundle_name
And in that bundle, it have an entity named "oro_customer_user", so i want to add a new column in that table using my new bundles.
I've searched a lot but still no luck.
Almost of solution say i need to fix in vendor/oro/bundles/bundle_name, which i don't want to do.
But still have some solution say i need to use DoctrineMigrationsBundle but i'm not sure about this.
https://symfony.com/doc/master/bundles/DoctrineMigrationsBundle/index.html
Please give advice, thanks :)
Alright, so i've found the solution for orocommerce
Just use Migration and everything is gonna be fine
You can check in this link:
https://forum.oroinc.com/orocrm/orocrm-programming-questions/topic/add-custom-field-into-orocrm-entity#post-24765
The migrate you have to create manual, because i don't know how to create migrate by command line :( .
After create migrate done, you only need to run this cmd:
php app/console oro:migration:load --show-queries
Now go and check in database, its done already.
And about entity:
I still don't know how to custom it in orocommerce. It got a lot of error.

Override DS default layout

Using Drupal 8
I need to override the default DS "One Column Layout".To do that I use the suggested template name: ds-1col--tools-tools.html.twig . I have placed that file in various locations and then cleared cache but Drupal never picks up on it:
mytheme/templates/ds
mytheme/ds_layouts/templates/
mytheme/templates/ds_layouts/
mytheme/templates/
None of this places work, what could I possibly be doing wrong?
Through a comment from #Matoeil , I looked through Twig Debug's suggestions and they suggested a different kind of name for the file. When using Twig debugs suggestion, it recognized it right away.
So I suppose the suggestions made by Display Suite don't seem to work very well.

DiagnosticOrder.Item - How should I incorporate other attributes

In our system , DiagnosticOrder.Item has many attributes. Example,
1. Code
2. Name
3. Parent Code
4. Problem with the code
5. Automatically added code ... and many more.
Seems to me , it will be more appropriate to create a new resource here. I see that DiagnosticOrder.Item is a backbone element.
Question is , should I create a new resource or should I use extension here for DiagnosticOrder.Item?
I am more inclined to create a new resource - but not sure how to create one ? If I have to create one , can you please guide me to create a new resource ?
At the moment, creating your own resource is non-compliant, though you could profile the Basic resource. What you're looking for sounds like an extension to me, though you could also look at DataElement.

Filter using project activity codes dissapper during copy in Primavera P6

I'm working on Primare P6 R8.4. I need to copy a project to work on a new scenario. When I do this activity filters using project activity codes dissapper in new copy. I need a walkaround to overcome this stiuation.
I know I can use EPS activity codes but those have problem with in XER exports.
You are right, when you copy the project, the filters will become empty. To keep the filters from clearing out when you copy the project, it's best to use Global Activity Codes. Even EPS Activity Codes may give you issues.
The only problem is with import / export - those activity codes will be exported and imported into someone else's database - even if they didn't want them.
An 2nd alternative is to avoid Activity Codes, and use User Defined Fields (UDF) instead. The filters will endure if you build them around UDFs.
The UDF is the same like activity codes.. it just disappears from the filters. I just tried making activity codes and filters global and the layouts are copied with the filters associated.Phew
You can try to use WS/API from EPPM

Doctrine migration couldn`t find non-existed class

I use doc:generate-migrations-diffto generate migration classes located in lib/migrations/. You already might know, that doc:generate-migrations-... tasks create some files in tmp directory. I had some problems with it and i delete all doctrine help files from tmp dir.
And now when I execute doc:generate-migrations-diff it fails with this message: Couldn't find class ToPrfxProduct2Site, I have Product2Site class, but there is no ToPrfxProduct2Site.
Any ideas?
Ok, i figured this out. Generating of migrations is based on existing models, so first try to find models that dont exists in your schema. For me there was Product2Site, Product2SiteTable' andBaseProduct2Site` models. Just delete this files and everything will be fine.

Resources