- Posts: 90
COMMUNITY FORUM
JCE editor problems
- Jock
- Topic Author
- Offline
- Premium Member
Less
More
13 years 4 months ago #96829
by Jock
JCE editor problems was created by Jock
Hi,
I recently re-installed Joomla (so I had the latest version) and then K2 followed by JCE. But for some reason all existing items are missing the JCE editor. The extra fields have no editor and the main content area has no embedded editor.
When I go to create a new item the editor is there and works fine. But when I go back to edit it the editor is not there?
Any ideas on what is going on here and how I can fix this?
I recently re-installed Joomla (so I had the latest version) and then K2 followed by JCE. But for some reason all existing items are missing the JCE editor. The extra fields have no editor and the main content area has no embedded editor.
When I go to create a new item the editor is there and works fine. But when I go back to edit it the editor is not there?
Any ideas on what is going on here and how I can fix this?
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 4 months ago #96830
by BBC
Replied by BBC on topic JCE editor problems
Search forum. You will find a link to JCE forum.
Please Log in or Create an account to join the conversation.
- Jock
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 90
13 years 4 months ago #96831
by Jock
Replied by Jock on topic JCE editor problems
I was going to post on the JCE forum but then I realized I had to pay and subscribe to make a post.
Or are you talking about another JCE forum?
Or are you talking about another JCE forum?
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 4 months ago #96832
by BBC
Replied by BBC on topic JCE editor problems
As it is some kind of bug. Don´t know where. I will post that one comment from JCE forum that is important.
Here is the fix I have sent to the K2 team:Open view.html.php in administrator/components/com_k2/views/items/view.html.phpReplace :
$js = "function initExtraFieldsEditor(){ $$('.k2ExtraFieldEditor').each(function(element) { var id = element.id; if (typeof JContentEditor != 'undefined') { if (tinyMCE.get(id)) { tinymce.EditorManager.remove(tinyMCE.get(id)); } tinyMCE.execCommand('mceAddControl', false, id); } else { new nicEditor({fullPanel: true, maxHeight: 180, iconsPath: '".JURI::root()."administrator/components/com_k2/images/system/nicEditorIcons.gif'}).panelInstance(element.getProperty('id')); } }); } function syncExtraFieldsEditor(){ $$('.k2ExtraFieldEditor').each(function(element){ editor = nicEditors.findEditor(element.getProperty('id')); if(typeof editor != 'undefined'){ editor.saveContent(); } }); } ";
with :
$js = "function initExtraFieldsEditor(){ $$('.k2ExtraFieldEditor').each(function(element) { if (typeof JContentEditor != 'undefined') { // wait until main editor is added tinyMCE.onAddEditor.add(function(mgr, ed) { // skip for extrafields editor if (ed.id == element.id) { return; } // wait until main editor is initialized ed.onInit.add(function() { tinyMCE.execCommand('mceAddEditor', false, element); }); }); } else { new nicEditor({fullPanel: true, maxHeight: 180, iconsPath: '".JURI::root()."administrator/components/com_k2/images/system/nicEditorIcons.gif'}).panelInstance(element.getProperty('id')); } }); } function syncExtraFieldsEditor(){ $$('.k2ExtraFieldEditor').each(function(element){ editor = nicEditors.findEditor(element.getProperty('id')); if(typeof editor != 'undefined'){ editor.saveContent(); } }); } ";
Here is the fix I have sent to the K2 team:Open view.html.php in administrator/components/com_k2/views/items/view.html.phpReplace :
$js = "function initExtraFieldsEditor(){ $$('.k2ExtraFieldEditor').each(function(element) { var id = element.id; if (typeof JContentEditor != 'undefined') { if (tinyMCE.get(id)) { tinymce.EditorManager.remove(tinyMCE.get(id)); } tinyMCE.execCommand('mceAddControl', false, id); } else { new nicEditor({fullPanel: true, maxHeight: 180, iconsPath: '".JURI::root()."administrator/components/com_k2/images/system/nicEditorIcons.gif'}).panelInstance(element.getProperty('id')); } }); } function syncExtraFieldsEditor(){ $$('.k2ExtraFieldEditor').each(function(element){ editor = nicEditors.findEditor(element.getProperty('id')); if(typeof editor != 'undefined'){ editor.saveContent(); } }); } ";
with :
$js = "function initExtraFieldsEditor(){ $$('.k2ExtraFieldEditor').each(function(element) { if (typeof JContentEditor != 'undefined') { // wait until main editor is added tinyMCE.onAddEditor.add(function(mgr, ed) { // skip for extrafields editor if (ed.id == element.id) { return; } // wait until main editor is initialized ed.onInit.add(function() { tinyMCE.execCommand('mceAddEditor', false, element); }); }); } else { new nicEditor({fullPanel: true, maxHeight: 180, iconsPath: '".JURI::root()."administrator/components/com_k2/images/system/nicEditorIcons.gif'}).panelInstance(element.getProperty('id')); } }); } function syncExtraFieldsEditor(){ $$('.k2ExtraFieldEditor').each(function(element){ editor = nicEditors.findEditor(element.getProperty('id')); if(typeof editor != 'undefined'){ editor.saveContent(); } }); } ";
Please Log in or Create an account to join the conversation.
- Jock
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 90
13 years 4 months ago #96833
by Jock
Replied by Jock on topic JCE editor problems
Hi,
That code doesn't even exist in that file for me?
That code doesn't even exist in that file for me?
Please Log in or Create an account to join the conversation.
- Jock
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 90
13 years 4 months ago #96834
by Jock
Replied by Jock on topic JCE editor problems
OK I found out that you actually mean this file:
administrator/components/com_k2/views/item/view.html.php
Notice the path is item and not items
Anyway, I think we are onto something here because this file doesn't look right to me. I edited it once uploaded it with your changes and the editor loaded on the content area but only the very 1st extra field had a JCE editor and the other fields didnt.
When I look at this line:
for($i=0; $i<sizeof($extraFields); $i++){ $extraFields[$i]->element=$extraFieldModel->renderExtraField($extraFields[$i],$item->id); }
Parts of it are also orange (in dreamweaver), which signifies to me that something is wrong with this file somewhere and that part is being commented out somehow?
administrator/components/com_k2/views/item/view.html.php
Notice the path is item and not items
Anyway, I think we are onto something here because this file doesn't look right to me. I edited it once uploaded it with your changes and the editor loaded on the content area but only the very 1st extra field had a JCE editor and the other fields didnt.
When I look at this line:
for($i=0; $i<sizeof($extraFields); $i++){ $extraFields[$i]->element=$extraFieldModel->renderExtraField($extraFields[$i],$item->id); }
Parts of it are also orange (in dreamweaver), which signifies to me that something is wrong with this file somewhere and that part is being commented out somehow?
Please Log in or Create an account to join the conversation.
- Jock
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 90
13 years 4 months ago #96835
by Jock
Replied by Jock on topic JCE editor problems
And then I uploaded it again and it is back to how it was with NO JCE editors loading.
Definitely something wrong with that file I feel.
How to troubleshoot?
Is there anywhere I can download older versions of JCE?
Definitely something wrong with that file I feel.
How to troubleshoot?
Is there anywhere I can download older versions of JCE?
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 4 months ago #96836
by BBC
Replied by BBC on topic JCE editor problems
That code above wont work witl latest SVN. Because code doesn´t exist.
Try to disable force white background, black text, in JCE. And write here if it helped.
Try to disable force white background, black text, in JCE. And write here if it helped.
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 4 months ago #96837
by BBC
Replied by BBC on topic JCE editor problems
That "items" was just misstyping. Correct is "Item".
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 4 months ago #96838
by BBC
Replied by BBC on topic JCE editor problems
This above is when JCE doesn´t work at all in K2. Not for extra fields.
I am satisfied with default K2 editor for fields. Don´t need all buttons from JCE.
Search forum, one guy had a solution for JCE and extra fields.
I am satisfied with default K2 editor for fields. Don´t need all buttons from JCE.
Search forum, one guy had a solution for JCE and extra fields.
Please Log in or Create an account to join the conversation.