J2.5.3
VM SVN
JCE is the editor, NOT TinyMCE
I've added a test field.
(http://static.xscreenshot.com/2012/03/19/18/screen_8a67e3b23c4f215f278a58b60770f9ee) (http://view.xscreenshot.com/8a67e3b23c4f215f278a58b60770f9ee)
When I first time add the custom field it's ok:
(http://static.xscreenshot.com/2012/03/19/18/screen_463ad23e1ee613446f53216a0ba6b259) (http://view.xscreenshot.com/463ad23e1ee613446f53216a0ba6b259)
I press save and see a regular textarea instead of the editor area:
(http://static.xscreenshot.com/2012/03/19/19/screen_eda8c6864a87b96d22b4ad5fbd8bb533) (http://view.xscreenshot.com/eda8c6864a87b96d22b4ad5fbd8bb533)
The key place is in administrator/components/com_virtuemart/models/customfields.php
Line 398
case 'X':
return '<textarea class="mceInsertContentNew" name="field['.$row.'][custom_value]" id="field-'.$row.'-custom_value">'.$field->custom_value.'</textarea>
<script type="text/javascript">// Creates a new editor instance
tinymce.execCommand("mceAddControl",true,"field-'.$row.'-custom_value")
</script></td><td>'.$priceInput;
//return '<input type="text" value="'.$field->custom_value.'" name="field['.$row.'][custom_value]" /></td><td>'.$priceInput;
break;
The code works for New editor, but not for a previously saved.
I tried to use:
$editor =& JFactory::getEditor();
return $editor->display('field['.$row.'][custom_value]',$field->custom_value, '550', '400', '60', '20', false).'</td><td>';
But there is a joomla bug (I think). When the code I tried is called from administrator/components/com_virtuemart/views/product/view.json.php it fails:
Fatal error: Call to undefined method JDocumentJSON::addCustomTag() in /mnt/work/www/klokkenbouwen.nla/www/virtuemart/libraries/joomla/html/editor.php on line 258
When called from JSON view Joomla uses JDocumentJSON, but method addCustomTag is fromJDocumentHTML.
So my suggestion is to add this code:
$document=& JFactory::getDocument();
if (get_class($document) == 'JDocumentHTML') {
$editor =& JFactory::getEditor();
return $editor->display('field['.$row.'][custom_value]',$field->custom_value, '550', '400', '60', '20', false).'</td><td>';
}
Patch:
Index: components/com_virtuemart/models/customfields.php
===================================================================
--- components/com_virtuemart/models/customfields.php (revision 5689)
+++ components/com_virtuemart/models/customfields.php (working copy)
@@ -396,6 +396,12 @@
break;
//'X'=>'COM_VIRTUEMART_CUSTOM_EDITOR',
case 'X':
+ $document=& JFactory::getDocument();
+ if (get_class($document) == 'JDocumentHTML') {
+ $editor =& JFactory::getEditor();
+ return $editor->display('field['.$row.'][custom_value]',$field->custom_value, '550', '400', '60', '20', false).'</td><td>';
+
+ }
return '<textarea class="mceInsertContentNew" name="field['.$row.'][custom_value]" id="field-'.$row.'-custom_value">'.$field->custom_value.'</textarea>
<script type="text/javascript">// Creates a new editor instance
tinymce.execCommand("mceAddControl",true,"field-'.$row.'-custom_value")
Index: components/com_virtuemart/views/product/tmpl/product_edit_custom.php
===================================================================
--- components/com_virtuemart/views/product/tmpl/product_edit_custom.php (revision 5689)
+++ components/com_virtuemart/views/product/tmpl/product_edit_custom.php (working copy)
@@ -239,4 +239,4 @@
//onsole.log(jQuery('#customfieldsTable').data('events'));
-</script>
\ No newline at end of file
+</script>
I think is a code change in j2.5 because it work perfectly for me :(
Problem is that we have depedent of Joomla / motools javascript.
Have you payed attention, that the editor is NOT the default one? It works perfect with the default one.
Same here.
I also have the JCE instaled and that Value field its now empty without editor
Hello
I have the same probleme here with JCE
Any help please?
Best regards
Amorino
And there is more :
After saving the editor JCE in description doesn't work any more
If I delete the custom field it works again
Any help please?
Best regards
Amorino
The patch above resolved my problem
Thank you Gruz
Best regards
Amorino
Thank's Gruz ! It's working now for me too. @ J2.5.6 , VM 2.0.7f
Are there possibilities of this patch go to the production version?
Thanks for this patch gruz.
Did you submit it to the dev team ?
It must be implemented in the future release ;)
Nice fix. Worked for me.
Thank you
HI all
Another Strange problem with Virtuemart 2.016 and JCE editor in the same area ...
Really boring it seems to be not corrected and it worst now ..
When you edit a product with custom field type Editor and use JCE as default :
Jce appears but you have to scale it up and virtuemart JS interprete it as you want to change the order .. and empty the content of the editor ..
Pliz help about it ... appreciated .. have many work to make on products ...
Hello
Yes we are looking at the problem.
ok .. would it be possible to post a fix in this thread if you find a way ? thanks :)
HI and scuse tu up this one but really need a fix for this ..
I have more than 20000 ref to edit and this problem is amazingly important ...
Hello
The fast solution I have is to go in the JCE configuration and change the size of the editor
- go in Edit Profile - [Default]
- Change Editor width, and Editor Height, and
- set Editor resizing to No
We are going to the the changes inside VM but for the next version.
Quote from: selor on January 05, 2013, 00:37:49 AM
... more than 20000 ref to edit and this problem is amazingly important ...
Hahaha, yes that is the right attitude. A small piece of the whole thing, for most people completly unimportant, but if you need it, then it can turn out as blocker.
Quote from: selor on January 05, 2013, 00:37:49 AM
I have more than 20000 ref to edit and this problem is amazingly important ...
When I have to edit a lot of database entries, I often use "HeidiSQL", a free mysql client, to edit the products directly in the database table. Saves a lot of clicks compared to using any Joomla editor.
I am having the same problem but with jckeditor.
Does anyone know how to call an instance of that instead of tinymce?
Thanks.
Quote from: Datatonic on March 26, 2013, 15:34:03 PM
I am having the same problem but with jckeditor.
As far as I know, VM uses a classname to identify editors. TinyMCE and JCE editors do have this classname to identify themselves. The other editors don't.
Ok so how do I call either .... just for this instance when JCK is default.
I really don't want to put the client in a position of having to switch out user or default editor to edit these fields with a WYSIWYG editor.
JCK Calls fine for product descriptions with no core edits.
Any pointers?
Thanks.
Quote from: Datatonic on March 26, 2013, 23:29:23 PM
...so how do I call either .... just for this instance when JCK is default.
Sorry, I have no idea at the moment. Maybe somebody else has. Personally I'm using JCE because that one works.
Hello,
I try to install your path, but i don't understand the second part.
Index: components/com_virtuemart/views/product/tmpl/product_edit_custom.php
===================================================================
--- components/com_virtuemart/views/product/tmpl/product_edit_custom.php (revision 5689)
+++ components/com_virtuemart/views/product/tmpl/product_edit_custom.php (working copy)
@@ -239,4 +239,4 @@
//onsole.log(jQuery('#customfieldsTable').data('events'));
-</script>
\ No newline at end of file
+</script>
What I did make?
I work with joomla 2.5, Virtuemart 2.0.
Quote from: Nenidd on June 27, 2013, 17:14:24 PM
I work with joomla 2.5, Virtuemart 2.0.
VirtueMart 2.0 is already 1 ½ years old. Use one of the latest versions (2.0.20b stable or a 2.0.21x developer version)
There is no need to alter the code. TinyMCE and JCE editors do work with newer versions of VM.
So, i could change and it was work again?
I'm work on 2.0.6 exactly. And this bug make me crazy.
Which editor do you use? TinyMCE and JCE 2.2.1 or higher do work within VirtueMart. Other editiors might not have implemented support for VirtueMart.
I make the upload! And it's work perfectly!
Thanks for you answer!
This should be fixed in the next release. I've implemented the proposed code change.
OpenGlobal E-commerce