Forums › Forums › OroCRM › OroCRM – Installation/Technical Issues or Problems › Oro 1.8 Lead select2 in Sale Process Error
This topic contains 10 replies, has 4 voices, and was last updated by pcahard 8 years, 5 months ago.
Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
- CreatorTopic
- October 8, 2015 at 5:54 am #26710
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 ?
- CreatorTopic
- AuthorReplies
- October 8, 2015 at 8:02 am #26711
Hey guy I have the same problem !
October 8, 2015 at 8:26 am #26712Hi guys,
Thanks for the heads up, we will fix this ASAP.
October 8, 2015 at 9:03 am #26713thanks for your help!
October 19, 2015 at 6:35 am #26714hi oro guys !
do you have some news about this issue ?
October 19, 2015 at 9:38 am #26715Hi,
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.
October 20, 2015 at 1:41 am #26716Hello 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.October 26, 2015 at 2:09 am #26717I 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);
October 26, 2015 at 2:46 am #26718If you prefer read the patch on gist, https://gist.github.com/pcahard/55b32647878b6e0a8a64
October 28, 2015 at 10:35 am #26719The 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 !!
October 29, 2015 at 7:50 am #26720Forget 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'
- AuthorReplies
The forum ‘OroCRM – Installation/Technical Issues or Problems’ is closed to new topics and replies.