Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » SimpleHTMLEditorField doesn't show in popup

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1387 Views
  • PapaBear
    Avatar
    Community Member
    26 Posts

    SimpleHTMLEditorField doesn't show in popup Link to this post

    Hi All,

    I have a weird error. I have a site using HasManyDOM to hold testimonials for a page. The Testimonial class has two HTML fields using SimpleHTMLEditorField in the popup. This works fine in all standard browsers on my computer (IE6+, FF, Opera, Chrome, Safari) and my colleagues computer. However, on the client's computer the SimpleHTMLEditorFields are not appearing in the popup although the popup appears and the other fields appear. The popup functionality in all other respects is fine. A new testimonial can be created but with no way to edit the two HTML text fields. This behaviour is the same across all browsers on the client's machine (tried with IE8 and FF3.8)

    I'm stumped as to possible cause. I suspect it's something locally on the client's machine but I can't seem to find anything that stands out as a cause.

    Does anyone have a suggestion?

  • cake
    Avatar
    Community Member
    19 Posts

    Re: SimpleHTMLEditorField doesn't show in popup Link to this post

    Yes, I can confirm this issue. SimpleTinyMCEField isn't working, too.
    DOM is outputting a regular Textarea within the popup.

    I have set

    Director::set_environment_type("dev");

    in _config.php because there was a known bug. But that doesn't solve my problem.

    I am using DOM r414 right now.

  • cake
    Avatar
    Community Member
    19 Posts

    Re: SimpleHTMLEditorField doesn't show in popup Link to this post

  • PapaBear
    Avatar
    Community Member
    26 Posts

    Re: SimpleHTMLEditorField doesn't show in popup Link to this post

    No, I'm not getting that issue. This website is using v2.3 and the related DOM version.

    It only occurs on this client's pc as far as I can tell so I'm pretty confident it is something related to her machine but I don't have any idea what.

  • silverseba
    Avatar
    Community Member
    26 Posts

    Re: SimpleHTMLEditorField doesn't show in popup Link to this post

    Finally a fix!

    I experienced the exact same problem with SS 2.4.3 and the latest revision of DataObjectManager (r511):
    The SimpleHTMLEditorField never showed up in a regular PopUp window of any ComplexTableField (e.g. HasOneComplexTableField, HasManyComplexTableField, ManyManyComplexTableField)

    The problem
    When using any kind of *ComplexTableField, jQuery was NOT loaded in the iframe of the PopUp window.
    So obviously none of the scripts of SimpleHTMLEditorField could run, because the required framework wasn´t loaded.

    The simple fix
    1. Use DataObjectManager instead of the *ComplexTableField (that´s what I´m doing now)

    2. If you want to use a ComplexTableField, replace the following lines of function FieldHolder() in SimpleHTMLEditorField.php:

       public function FieldHolder()
       {
          Requirements::javascript('sapphire/thirdparty/jquery/jquery-packed.js'); // load jquery framework for following scripts to run
          Requirements::javascript('dataobject_manager/javascript/jquery.wysiwyg.js');
          Requirements::css('dataobject_manager/css/jquery.wysiwyg.css');
          Requirements::customScript("
             // use 'jQuery' call instead of '$' to prevent problems with prototype framework
             jQuery(function() {
                jQuery('#{$this->id()}').wysiwyg({
                   {$this->getConfig()}
                }).parents('.simplehtmleditor').removeClass('hidden');
                
             });
          ");
          return parent::FieldHolder();      
       }

    @UncleCheese: could you please add this fix to the source code of your module. This fix solves the problems when using a ComplexTableField, but doesn´t affect the use in combination with DataObjectManager.

    1387 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.