ssossossosso

Forums

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

This topic contains 10 replies, has 4 voices, and was last updated by  pcahard 2 years ago.

  • Creator
    Topic
  • #13523

    kelton23om
    Participant

    After an update to the 1.8 version, we note a big issue when we use a select2 related to channel.
    The same issue appear in your demo version.

    The bug is simple to reproduce, you start a new sale process from a lead and try to select a lead.
    – The autocomplation does not work.
    – The grid display data but when you select one lead it doesn’t fill the form field.
    – Same thing when you create a new one.
    In resume, we can not create a sales process.

    Anything about that ?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Author
    Replies
  • #13549

    pcahard
    Participant

    Hey guy I have the same problem !

    #13550
    Artem Liubeznyi
    Artem Liubeznyi
    Oro Core

    Hi guys,

    Thanks for the heads up, we will fix this ASAP.

    #13552

    kelton23om
    Participant

    thanks for your help!

    #13651

    kelton23om
    Participant

    hi oro guys !

    do you have some news about this issue ?

    #13653

    pcahard
    Participant

    Hi,

    I think, I have found the source of the problem.

    The url used in the select2-component (in FormBundle/Resources/public/js/app/components/)
    is bad, we have something like “/datagrid/sales-funnel-lead-grid” and we should have “/autocomplete/search”.

    Maybe this can help you, Pierre.

    #13663
    Ivan Klymenko
    Ivan Klymenko
    Oro Core

    Hello guys!

    kelton23om,
    we have this issue in our backlog and will provide the fix in the closest release. We’ll update this thread when the issue will fixed in the development version. Thanks for your patience.

    pcahard,
    thanks for the idea! We will check it.

    #13706

    pcahard
    Participant

    I solved it with two patchs, this works but this could maybe have side effect.

    Patch for the search:

    diff -urN vendor-original/oro/platform/src/Oro/Bundle/FormBundle/Resources/views/Form/fields.html.twig vendor/oro/platform/src/Oro/Bundle/FormBundle/Resources/views/Form/fields.html.twig
    --- vendor-original/oro/platform/src/Oro/Bundle/FormBundle/Resources/views/Form/fields.html.twig 2015-10-26 09:45:05.106415609 +0100
    +++ vendor/oro/platform/src/Oro/Bundle/FormBundle/Resources/views/Form/fields.html.twig 2015-10-26 09:50:05.712796197 +0100
    @@ -1,7 +1,9 @@
    {% extends 'OroUIBundle:Form:fields.html.twig' %}

    {% block genemu_jqueryselect2_widget %}
    - {% if configs.grid is defined and configs.grid.name is defined %}
    + {% if configs.route_parameters.url is defined %}
    + {% set url = path(configs.route_parameters.url) %}
    + {% else if configs.grid is defined and configs.grid.name is defined %}
    {% set url = path('oro_datagrid_index', {'gridName': configs.grid.name}) %}
    {% elseif configs.route_name is defined and configs.route_name %}
    {% set url = path(configs.route_name, configs.route_parameters | default([])) %}

    Patch for update select2 when we click on the datagrid.

    diff -urN vendor-original/oro/platform/src/Oro/Bundle/FormBundle/Form/Type/OroJquerySelect2HiddenType.php vendor/oro/platform/src/Oro/Bundle/FormBundle/Form/Type/OroJquerySelect2HiddenType.php
    --- vendor-original/oro/platform/src/Oro/Bundle/FormBundle/Form/Type/OroJquerySelect2HiddenType.php 2015-10-26 09:45:05.090416111 +0100
    +++ vendor/oro/platform/src/Oro/Bundle/FormBundle/Form/Type/OroJquerySelect2HiddenType.php 2015-10-26 09:46:53.591010193 +0100
    @@ -227,9 +227,9 @@
    $result[] = $converter->convertItem($form->getData());
    }

    - $vars['attr'] = [
    - 'data-selected-data' => json_encode($result)
    - ];
    +// $vars['attr'] = [
    +// 'data-selected-data' => json_encode($result)
    +// ];
    }

    $view->vars = array_replace_recursive($view->vars, $vars);

    #13707

    pcahard
    Participant

    If you prefer read the patch on gist, https://gist.github.com/pcahard/55b32647878b6e0a8a64

    #13833

    pcahard
    Participant

    The update of the template was wrong, this works but select all leads (instead of lead with status new)..
    I have done some debug in the javascript and i see that the callback apply in the Select2Component, here:

    var response = func.call(this, data, page);

    use the method “results” of Select2Component in my application (and this not work)
    and use a Select2GridComponent instead in a fresh install (and this work).

    from Select2Component:

    results: function(data, page) {
    return data;
    }

    from Select2GridComponent:

    results: function(data, page) {
    return {
    results: data.data,
    more: page * that.perPage < data.options.totalRecords
    };
    }

    So, check the config of the lead widget, and i could see in my case my component is “autocomplete-channel-aware” and in the demo it’s “grid-channel-aware”.

    it’s a really tricky bug, please let me know id this could help !!

    #13856

    pcahard
    Participant

    Forget all patches, I have just updated the lead form_options of sales process’s workflow with the option: “component: grid”


    lead:
    form_type: orocrm_sales_lead_select
    options:
    grid_name: 'sales-funnel-lead-grid'
    configs:
    extra_config: 'grid'
    component: 'grid'

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

You must be logged in to reply to this topic.