Results 1 to 8 of 8

Thread: Fatal Smarty Error when adding TinyMCE

  1. #1
    spyro187 is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    27

    Default Fatal Smarty Error when adding TinyMCE

    Recently I went through the Bending Sugar with Majed Itani video and attempted to add TinyMCE to a description field of a custom module. Video can be found at http://developers.sugarcrm.com/tutorials.php

    Step 1: Added the following code to editviewdefs
    PHP Code:
    require_once("include/SugarTinyMCE.php");
    $tiny = new SugarTinyMCE();
    $tiny->defaultConfig['cleanup_on_startup']=true;
    $tinyHtml $tiny->getInstance('description'); 
    Step 2: Use new code for the description field in editviewdefs
    PHP Code:
    array(
            
    'name'=>'description',
            
    'customCode'=>'<textarea id="description" name="description">{$fields.description.value}</textarea>{literal}'$tinyHtml '<script>focus_obj = document.getElementById("description");</script>{/literal}',
            
    'displayParams'=>array('required'=>false,'rows'=>5,'cols'=>60)
            ), 
    Step 3: Save and test
    In this step I refreshed the edit view of the custom module and recieved teh following:
    Fatal error: Smarty error: [in cache/modules/pack_MyMod/EditView.tpl line 128]: syntax error: unidentified token '.C:\xampp\htdocs\include\Smarty\Smarty.class.php on line 1095

    System specs:
    I am running SugarCRM Enterprise 5d on XAMPP for Windows.

    Any ideas on what the problem is?

  2. #2
    ptemplin7 is offline Sugar Community Member
    Join Date
    Jun 2007
    Location
    Puget Sound Washington
    Posts
    380

    Default Re: Fatal Smarty Error when adding TinyMCE

    Did you rebuild the extensions and clear the cache yet? (ie. repair and rebuild from the admin panel)

    You can try turning on the debug mode and do it again and see if there is a sql error as well.

    Hope you get it figured out,
    paris

  3. #3
    spyro187 is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    27

    Default Re: Fatal Smarty Error when adding TinyMCE

    I am in dev mode so I shouldn't be caching. I have repaired and rebuilt multiple times while changing things around.

    Since I just figured out how to set debug mode, I will try that today and see if it uncovers anything.

  4. #4
    jederner is offline Junior Member
    Join Date
    Oct 2008
    Posts
    2

    Smile Re: Fatal Smarty Error when adding TinyMCE

    Did you rebuild the extensions and clear the cache yet? (ie. repair and rebuild from the admin panel)
    This worked for me. Thanks!

  5. #5
    tyagiakhil is offline Sugar Community Member
    Join Date
    Nov 2007
    Posts
    52

    Default Re: Fatal Smarty Error when adding TinyMCE

    From this video tutorial - http://developers.sugarcrm.com/Bendi..._1/t/8/viewed/
    To show this field value on Detail view page, add this to sugar_root/modules/<module name>.php

    function retrieve ($id) {
    $object = parent::retrieve($id);
    $this->description = from_html($this->description);
    return $this;
    }

    function get_list_view_array () {
    $array = parent::get_list_view_array();
    $array['DESCRIPTION'] = from_html($array['DESCRIPTION']);
    return $array;
    }


    Thanks

  6. #6
    nvdp2002 is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    134

    Default Re: Fatal Smarty Error when adding TinyMCE

    I am actualy busy with this tutorial at the moment. the moment i edit the <module name>.php to what is suggested in the module. the sugar blog link returns a blank page. after commenting out
    like this


    /*function retrieve ($id) {
    $object = parent::retrieve($id);
    $this->description = from_html($this->description);
    return $this;
    }*/

    Then the list view shows correctly but not the detail view.

    any ideas

    im using sugar 5.2

  7. #7
    nvdp2002 is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    134

    Default Re: Fatal Smarty Error when adding TinyMCE

    ok after looking at my screen for an hour without blinking and nearly going blind i realised that i had left out the $ sign in the first line

    I had

    function retrieve (id) {

    Instead of

    function retrieve ($id) {


    PALM - FACE - HARD !!!

  8. #8
    flymirco is offline Senior Member
    Join Date
    Jan 2009
    Posts
    81

    Question Re: Fatal Smarty Error when adding TinyMCE

    Hi all,

    I am using SugarCRM CE 5.2.0.f on a local XAMPP for windows server.
    I followed all the steps and I got a first textarea field working fine with tinyMCE.

    Now I need to use tinyMCE in both textarea fields of my module. I replicate what I coded for the first one but only one of two fields works correctly. The fields are description and note.

    This is the code of custom/modules/<my module>/metadata/editviewdefs.php:
    PHP Code:
    // For TinyMCE use
    require_once("include/SugarTinyMCE.php");

    // Campo description
    $tiny = new SugarTinyMCE();
    $tiny->defaultConfig['cleanup_on_startup']=true;
    $tinyHtml $tiny->getInstance('description');

    // Campo note
    $tinyNote = new SugarTinyMCE();
    $tinyNote->defaultConfig['cleanup_on_startup']=true;
    $tinyNoteHtml $tinyNote->getInstance('note'); 
    than in the panel array I have putted this code:
    PHP Code:
    => 
            array (
              
    => 
              array(
                
    'name'=>'description',
                
    'label' => 'LBL_DESCRIPTION',
                
    'customCode'=>'<textarea id="description" name="description">{$fields.description.value}</textarea>{literal}'$tinyHtml '<script>focus_obj = document.getElementById("description");</script>{/literal}',
                
    'displayParams'=>array('required'=>false,'rows'=>5,'cols'=>60)            
              ),
            ),
            
    => 
            array (
              
    => 
              array (
                
    'name' => 'note',
                
    'label' => 'LBL_NOTE',
                
    'customCode'=>'<textarea id="note" name="note">{$fields.note.value}</textarea>{literal}'$tinyNoteHtml '<script>focus_obj = document.getElementById("note");</script>{/literal}',
                
    'displayParams'=>array('required'=>false,'rows'=>5,'cols'=>60)            
              ),
            ), 
    Only note is shown as a tinyMCE field, in EditView and DetailView.

    Any idea?

    There is also an issue on DetailView: I can modifiy the code. I just wanto to show the html, I don't need the tinyMCE toolbar. I can achieve those thing goals?

    Thanks.

    flymirco

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Query Failed: AND users.id = '1'::MySQL error 1064:
    By artco001 in forum Installation and Upgrade Help
    Replies: 63
    Last Post: 2009-05-07, 05:56 AM
  2. Replies: 19
    Last Post: 2008-04-11, 05:41 PM
  3. Replies: 1
    Last Post: 2008-02-22, 04:25 PM
  4. Replies: 5
    Last Post: 2007-11-13, 02:51 PM
  5. Replies: 1
    Last Post: 2006-09-11, 03:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •