ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 4 replies, has 3 voices, and was last updated by Bhavesh Tailor Bhavesh Tailor 9 months, 3 weeks ago.

  • Creator
    Topic
  • #24189
    stef
    stef
    Participant

    The create user api route has a constraint that disallows the password attribute in the api call.

    I am currently facing the following requirement:

    1. user creates an (unconfirmed) account by setting his email and password
    2. Upon submit, confirmation email is sent and visiting the link in the email activates the account.

    The existing api call has 2 constraints preventing this, username cannot be empty and password is not whitelisted to be passed through the api. How could I override these validations?

    Thanks!


    Dream, in a pragmatic way.
    — Aldous Huxley

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #24198

    Vova Soroka
    Oro Core

    Hello @stef,

    By default API checks all constraints from “Default” and “api” validation groups. There is no easy way to disable a particular constraint due to restrictions of Symfony forms. You can try to change validation group using “form_options” (please see https://github.com/orocrm/platform/blob/master/src/Oro/Bundle/ApiBundle/Resources/doc/configuration.md#entities-configuration-section), but I cannot recommend this way because in this case you will lose all default constraints and you have to implement and maintain your own constraints.

    For now I do not see a solution for this issue, but I will try to find it. Please let me know if you have any ideas how to disable a particular constraint. I guess it might be useful in some cases like your.

    #24968
    Bhavesh Tailor
    Bhavesh Tailor
    Participant

    Hi ,

    Can you suggest me how to remove b2bcustomer validation constraint from inline-edit datagrid . While i am trying to click on update it’s follow below link

    http://uourdomain.local/app_dev.php/api/rest/latest/entity_data/OroCRM_Bundle_SalesBundle_Entity_Opportunity/90
    and then pass an error : –

    {“code”:400,”message”:”Validation Failed”,”errors”:{“errors”:[“This value should not be blank.”],”children”
    :{“status”:[],”owner”:[]}}}

    This error getting because of null value for b2bcustomer into orocrm_sales_opportunity table and inside validation.yml

    customer:
    – Valid: ~
    – NotBlank: ~

    Please suggest how to disable validation for inline edit datagrid ..

    Thank You in advance

    Bhavesh


    Bhavesh

    #24998
    Bhavesh Tailor
    Bhavesh Tailor
    Participant

    Hello ,

    Is there any way to override OroCRM/Bundle/SalesBundle/Resources/config/validation.yml form our custom bundle . i did try validation_groups into custom folder opportynity_type.php like

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
    $resolver->setDefaults(
    array(
    ‘data_class’ => ‘OroCRM\Bundle\SalesBundle\Entity\Opportunity’,
    ‘intention’ => ‘opportunity’,
    ‘validation_groups’ => [‘ms_edit’]
    )
    );
    }

    it’s not work for opportunity datagrid inline edit . Please suggest me how can i solve this issue .
    As Per mention into above post while i remove customer constraint from validation.yml and clear the cache it’s work for me but with this constraint i am not able to edit datagrid data .

    Thank You


    Bhavesh

    #30469
    Bhavesh Tailor
    Bhavesh Tailor
    Participant

    Hi ,

    Please help me.

    I did remove b2b customer field from opportunity thats why into my table orocrm_sales_opportunity customer_id is null. While i trying to edit status,probability etc. then i got error “This value should not be blank.” . While i remove code from

    OroCRM/Bundle/SalesBundle/Resources/config/validation.yml

    customer:
    – Valid: ~
    – NotBlank: ~

    Then I am able to update fields . How can i override this validation.yml for inline edit datagrid

    Is there any way to override OroCRM/Bundle/SalesBundle/Resources/config/validation.yml form our custom bundle . i did try validation_groups into custom folder

    /Workspace/orocrmdemo/src/MarketSnap/Bundle/SalesBundle/Form/Type/OpportunityType.php

    or also try

    Workspace/orocrmdemo/src/MarketSnap/Bundle/SalesBundle/Form/Extension/OpportunityTypeExtension.php

    like

    it’s not work for opportunity datagrid inline edit . Please suggest me how can i solve this issue .
    As Per mention into above post while i remove customer constraint from validation.yml and clear the cache it’s work for me but with this constraint i am not able to edit datagrid data .

    Thank You


    Bhavesh

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.