Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.248.2.49 -r1.248.2.50 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 22 Apr 2017 17:34:04 -0000 1.248.2.49 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 23 Apr 2017 13:32:33 -0000 1.248.2.50 @@ -2156,7 +2156,7 @@ imageSelectorDialog: '[my imageSelectorDialog]?parent_id=[[my object] item_id]', ready_callback: '$ready_callback2', customConfig: '[my customConfig]', - textarea_id: '[my set id]' + textarea_id: id }] if {[my allowedContent] ne ""} { append options " , allowedContent: '[my allowedContent]'\n" @@ -2179,7 +2179,8 @@ ::xo::Page requireJS [subst -nocommands { function load_$id (id) { - \$('#id').ckeip(function() { $callback }, { + // must use id provided as argument + \$('#' + id).ckeip(function() { $callback }, { name: '$name', ckeditor_config: { $options, @@ -2247,9 +2248,8 @@ set callback [my callback] ::xo::Page requireJS [subst -nocommands { function load_$id (id) { - \$('#$id').ckeditor(function() { $callback }, { - $options - }); + // must use id provided as argument + \$('#' + id).ckeditor(function() { $callback }, {$options}); } }] if {!$is_repeat_template} { Index: openacs-4/packages/xowiki/www/resources/repeat.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/repeat.js,v diff -u -r1.3.2.5 -r1.3.2.6 --- openacs-4/packages/xowiki/www/resources/repeat.js 5 Mar 2017 15:50:07 -0000 1.3.2.5 +++ openacs-4/packages/xowiki/www/resources/repeat.js 23 Apr 2017 13:32:33 -0000 1.3.2.6 @@ -140,13 +140,17 @@ try { window[functionname](idofeditor); } catch(err) { - console.log('function: ' + functionname + ' not found, we are trying to use the function of the repeat-template - error:' + err); - var functionname = 'load_' + ck_editors[j].getAttribute('data-repeat-template-id'); - console.log('reloading ckeditor functionname: ' + functionname); + // The named function does not exist. Try to call the + // function of the template element (in repeated items + // on position 0) and pass the actual id as argument. + console.log('function: ' + functionname + + ' not found, we are trying to use the function of the repeat-template - error:' + err); + var functionnameTemplate = 'load_' + ck_editors[j].getAttribute('data-repeat-template-id'); + console.log('reloading ckeditor functionname: ' + functionnameTemplate); try { - window[functionname](idofeditor); + window[functionnameTemplate](idofeditor); } catch(err) { - console.log('function: ' + functionname + ' not found (repeat-template) , error:' + err); + console.log('function: ' + functionnameTemplate + ' not found (repeat-template) , error:' + err); } } } @@ -467,13 +471,14 @@ try { window[functionname](idofeditor); } catch(err) { - console.log('function: ' + functionname + ' not found, we are trying to use the function of the repeat-template - error:' + err); - var functionname = 'load_' + ck_editors[j].getAttribute('data-repeat-template-id'); - console.log('reloading ckeditor functionname: ' + functionname); + console.log('function: ' + functionname + + ' not found, we are trying to use the function of the repeat-template - error:' + err); + var functionnameTemplate = 'load_' + ck_editors[j].getAttribute('data-repeat-template-id'); + console.log('reloading ckeditor functionname: ' + functionnameTemplate); try { - window[functionname](idofeditor); + window[functionnameTemplate](idofeditor); } catch(err) { - console.log('function: ' + functionname + ' not found (repeat-template) , error:' + err); + console.log('function: ' + functionnameTemplate + ' not found (repeat-template) , error:' + err); } } }