Keyword

Extra fields - values not saved

  • Novalee
  • Novalee's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 10 months ago #60072 by Novalee
Extra fields - values not saved was created by Novalee
Hey there,
I got a big issue: I made some extra fields in K2 and every field that is a textarea isn't saved!
I use the JoomlaCK Editor and have the k2tabber template.
as I use the TinyMC Editor there is no such problem.
Does anyone have a solution for this?
Thanks in advance,
Stef

Please Log in or Create an account to join the conversation.

  • Novalee
  • Novalee's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 9 months ago #60073 by Novalee
Replied by Novalee on topic Re: Extra fields - values not saved
Hey,

does nobody have the same problem?
Is anybody using JCK Editor with extra fields?

Kind regards,
Stef

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #60074 by Robert
Replied by Robert on topic Re: Extra fields - values not saved
I too have just installed K2 and have the Joomla CK Editor www.joomlackeditor.com/
When I have a textarea Extra Field setup and Use Editor checked the data does not save when the Save button is clicked.
You actually see the content disappear when you click the button.

You are correct Stef, changing Editors to TinyMCE makes it work so the issue is with Joomla CK editor.

I think we will have to report the issue to Joomla CK since TinyMCE works without issue unless someone from K2 figures out the issue.

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #60075 by Andrew
Replied by Andrew on topic Re: Extra fields - values not saved
This issue is not only caused with our editor JCKeditor but any editor that implements the CKEDITOR framework and that would include the ArtofEditor written by
Andrew Eddie.

This issue is caused by the NicEdit editor that K2 have chosen to use with their extra fields textfields types. And it seems it may be due to a focus issue but anyway the Editor fails to automatically update properly with the contents added to it.

However, I have found that you can force the editor to update all internal references properly by calling the getContent function.

So in the syncExtraFieldsEditor function on line 646 in the K2.js file change

function syncExtraFieldsEditor() {
$K2('.k2ExtraFieldEditor').each(function() {
editor = nicEditors.findEditor($K2(this).attr('id'));
if (typeof editor != 'undefined') {
if(editor.content == '<br>' || editor.content == '<br />'){
editor.setContent('');
}
editor.saveContent();
}
});
}


to

function syncExtraFieldsEditor() {
$K2('.k2ExtraFieldEditor').each(function() {
editor = nicEditors.findEditor($K2(this).attr('id'));
var content = editor && editor.getContent();
if (typeof editor != 'undefined') {
if(content == '<br>' || content == '<br />'){
editor.setContent('');
}
editor.saveContent();
}
});
}


Now it works with any Editor!

Hope they will implement that fix soon

Regards

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum