Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
Forum Replies Created
-
AuthorReplies
-
Considering your documentation on https://oroinc.com/orocrm/forums/topic/how-to-override-parts-of-oro/#post-63331
Is it possible to have 2 bundles extending the same js component? Imagine you have bundle A that adds component A and bundle B that adds component B. And you want, on both bundles, initialize the component on line-item-view.js (order contexts, like you do for product-unit-component)
If we extend LineItemView adding on initialize method the init of new components, in both bundles, then just the one with high priority will be executed, right?
what would be the best (and clean) approach for these case?
ThanksI couldn’t get it working on my side without your workaround. Attribute was added to default family on my migrations too.
If I back to this topic again I’ll post my finds.
Thanks.Hi iantypenko,
I’m using platform 2.6 and commerce 1.6
What you mean with “New field should be added automatically to the search index”?
Don’t we need to add “searchable”=>true?
If I don’t add that, then the field isn’t searchable.Regarding your suggestion if I clear cache and run the migration:load I don’t get the error. But I don’t want to run that, I mean I don’t want to have a error.
For the workaround I got this:
Shell12345678910> Oro\Bundle\OrganizationProBundle\Migrations\Schema\UpdateConfigsWithOrganizationMigration> Oro\Bundle\EntityConfigBundle\Migration\WarmUpEntityConfigCacheMigrationLoading permissions...[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]The value "string" is not allowed for path "mappings.Oro\Bundle\ProductBundle\Entity\Product.fields.color.type". Permissible values: "text", "decimal", "integer", "datetime"security:permission:configuration:load [--permissions [PERMISSIONS]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--disabled-listeners DISABLED-LISTENERS] [--current-user CURRENT-USER] [--current-organization CURRENT-ORGANIZATION] [--] <command>I changed ‘type:string’ by ‘type:text’ and it worked.
Is this the best approach to add a new searchable attribute? What is the best practice to add a searchable attribute programmatically without having that issue on migration load?
thanksFebruary 19, 2018 at 10:34 am in reply to: Functional tests, how to access extended entities methods (custom attributes) #34507Hi msulima
Thanks for reply, we found the issue. It was a side effect from other new unit test added recently that was broken the cache generation.
It was not clear because when we run the test isolated we didn’t got the issue, but when we tried to run all tests the issue came up in our pipeline.
So it’s fine.
thanksFebruary 19, 2018 at 4:30 am in reply to: Functional tests, how to access extended entities methods (custom attributes) #34505Hi again,
We update to 1.6.0 version and it’s strange now we are getting a similar issue.
When it tries to load the data for functional test:PHP12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758class LoadContentNodePageData extends AbstractFixture implements DependentFixtureInterface{const NODE_1 = 'node.1';const NODE_2 = 'node.2';const CHILD_NODE_1_1 = 'childnode.1.1';const CHILD_NODE_1_2 = 'childnode.1.2';/*** @var array*/protected static $contentNodes = [self::NODE_1 => ['children' => [self::CHILD_NODE_1_1 => [],self::CHILD_NODE_1_2 => []]],self::NODE_2 => ['children' => []],];/*** {@inheritdoc}*/public function getDependencies(){return [LoadWebCatalogData::class];}/*** {@inheritdoc}*/public function load(ObjectManager $manager) : void{/** @var WebCatalog $webCatalog */$webCatalog = $this->getReference(LoadWebCatalogData::CATALOG_1);foreach (self::$contentNodes as $node => $data) {$contentNode = new ContentNode();$contentNode->addTitle((new LocalizedFallbackValue())->setString($node));$contentNode->setWebCatalog($webCatalog);foreach ($data['children'] as $child => $childData) {$childNode = new ContentNode();$childNode->addTitle((new LocalizedFallbackValue())->setString($child));$childNode->setWebCatalog($webCatalog);$manager->persist($childNode);$contentNode->addChildNode($childNode);}$manager->persist($contentNode);$this->setReference($node, $contentNode);}$manager->flush();}}We get the error below on “$manager->persist($childNode);” execution:
PHP1ReflectionException: Property Oro\Bundle\WebCatalogBundle\Entity\ContentNode::$metaTitles does not existWe checked on htdocs/app/cache/test/oro_entities/Extend/Entity/EX_OroWebCatalogBundle_ContentNode.php the field $metaTitles is there.
Is this still not possible, have a support of multilingual field types for custom fields? We need that too.
February 14, 2018 at 9:44 am in reply to: Functional tests, how to access extended entities methods (custom attributes) #34504Thanks msulima!
Yes, we have one for test and other for dev/prod.I run ‘console oro:platform:update –env=test’ and I got the extended class updated with the custom ‘image’ field. Now my tests are running successfully! Thanks.
February 14, 2018 at 7:31 am in reply to: Functional tests, how to access extended entities methods (custom attributes) #34502@msulima
1. Field was created through a migration using AttachmentExtensionAwareInterface, likePHP123456789101112131415161718/*** @param Schema $schema* @param $fieldName* @param array $mimeTypes*/public function addContentNodeImageAssociation(Schema $schema, $fieldName, array $mimeTypes = []){$this->attachmentExtension->addImageRelation($schema,self::CONTENT_NODE_TABLE_NAME,$fieldName,[],self::MAX_CATEGORY_IMAGE_SIZE_IN_MB,self::THUMBNAIL_WIDTH_SIZE_IN_PX,self::THUMBNAIL_HEIGHT_SIZE_IN_PX,$mimeTypes);}2. What do you mean with “installed for test environment” ? Like running ‘console oro:platform:update –env=test’? I didn’t run that.
The installation has cache for test, I checked the app/cache/test/ folder, it has content and I can see the file ‘htdocs/app/cache/test/oro_entities/Extend/Entity/EX_OroWebCatalogBundle_ContentNode.php’. But image field isn’t there.
On htdocs/app/cache/dev/oro_entities/Extend/Entity/EX_OroWebCatalogBundle_ContentNode.php I can see the image field there.
-
AuthorReplies