In version 2.9.11 when i add multiple repeaters it causes some unexpected issues. When i rollback elementor to 2.9.8 everything works just fine.
`
$this->start_controls_section(
'mc_test',
[
'label' => esc_html__('Test', 'mycar-core'),
'tab' => Controls_Manager::TAB_CONTENT
]
);
$repeater = new Repeater();
$repeater->add_control(
'text',
[
'label' => esc_html__('Text', 'mycar-core'),
'type' => Controls_Manager::TEXT
]
);
$this->add_control(
'test_1',
[
'label' => esc_html__('Test 1', 'mycar-core'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls()
]
);
$repeater = new Repeater();
$repeater->add_control(
'text',
[
'label' => esc_html__('Text', 'mycar-core'),
'type' => Controls_Manager::TEXT
]
);
$this->add_control(
'test_2',
[
'label' => esc_html__('Test 1', 'mycar-core'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls()
]
);
$this->end_controls_section();
`
After first time i add this widget all repeater controls work just fine. However after i refresh elementor edit page and try to add new item to one of these repeaters it doesn't nothing and console throw errors:
common.min.js?ver=2.9.11:2 TypeError: Cannot read property 'id' of undefined
at i.get (editor.min.js?ver=2.9.11:2)
at initialize (editor.min.js?ver=2.9.11:2)
at initialize (editor.min.js?ver=2.9.11:2)
at i.h.View (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,underscore,shortcode,utils,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jqu&load[chunk_1]=ery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.4.1:16)
at i.constructor (backbone.marionette.min.js?ver=2.4.5:22)
at i.constructor (backbone.marionette.min.js?ver=2.4.5:22)
at i.constructor (backbone.marionette.min.js?ver=2.4.5:23)
at i [as constructor] (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,underscore,shortcode,utils,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jqu&load[chunk_1]=ery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.4.1:16)
at i [as constructor] (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,underscore,shortcode,utils,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jqu&load[chunk_1]=ery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.4.1:16)
at new i (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,underscore,shortcode,utils,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jqu&load[chunk_1]=ery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.4.1:16)
consoleError @ common.min.js?ver=2.9.11:2
backbone.marionette.min.js?ver=2.4.5:22 Uncaught TypeError: Cannot read property 'cid' of undefined
at c.findByModel (backbone.marionette.min.js?ver=2.4.5:22)
at i.onButtonAddRowClick (editor.min.js?ver=2.9.11:31)
at HTMLDivElement.dispatch (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,underscore,shortcode,utils,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jqu&load[chunk_1]=ery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.4.1:3)
at HTMLDivElement.r.handle (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,underscore,shortcode,utils,backbone,wp-util,wp-backbone,media-models,moxiejs,plupload,wp-plupload,jqu&load[chunk_1]=ery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable&ver=5.4.1:3)
Specific steps to reproduce:
- Add widget
- Add at least one item to repeater
- Save and refresh page
- Add another item to repeater
- no reaction and errors on console
Everything works just fine if there is just one repeater.
In version 2.9.11 when i add multiple repeaters it causes some unexpected issues. When i rollback elementor to 2.9.8 everything works just fine.
`
$this->start_controls_section(
'mc_test',
[
'label' => esc_html__('Test', 'mycar-core'),
'tab' => Controls_Manager::TAB_CONTENT
`
After first time i add this widget all repeater controls work just fine. However after i refresh elementor edit page and try to add new item to one of these repeaters it doesn't nothing and console throw errors:
Specific steps to reproduce:
Everything works just fine if there is just one repeater.