Dear all,

I am trying the new functionalities of Invenio last version and discovered what might be a bug.

If you add a new mandatory CKEDITOR bibformat element and you call it 'WYSIWYG', defined as a 'Response' element type, with this code (similar to the ABSE element used at demo journal submission): -------------------------------------------------------------------------------------

from invenio.htmlutils import get_html_text_editor

from invenio.config import CFG_SITE_URL

from invenio.search_engine_utils import get_fieldvalues

import os

if ('modify' in curdir) and not os.path.exists("%s/WYSIWYG" % curdir):

    try:

        content = get_fieldvalues(int(sysno), '520__a')[0]

    except:

        content = ''

elif os.path.exists("%s/WYSIWYG" % curdir):

    content = file("%s/WYSIWYG" % curdir).read()

else:

    content = ''

text = get_html_text_editor("WYSIWYG",id="BulletinCKEditor2",
content=content, toolbar_set="WebJournal", width='522px',
height='700px', file_upload_url=CFG_SITE_URL + '/submit/attachfile',
custom_configurations_path='/ckeditor/journal-editor-config.js')

-------------------------------------------------------------------------------------

When you click the "finish submission" button, the tester2 function is called, and it tries to get what you typed in the WYSIWYG textarea by using:

el = document.forms[0].elements['WYSIWYG'].value


But this always returns an empty string.

What tester2 function should be checking is

CKEDITOR.instances.BulletinCKEditor2.getData()


I've fix this by changing the code of tester2 function at /opt/invenio/lib/python/invenio/websubmit_templates.py

Best regards,
Miguel

Reply via email to