Results 1 to 5 of 5

Thread: StudioParser.php non-existing class xtemplate

  1. #1
    simple is offline Sugar Community Member
    Join Date
    Jul 2005
    Posts
    259

    Default StudioParser.php non-existing class xtemplate

    Hi

    we get an error when we try to Preview or Compare a version from the history (Studio, Account module, Search Layout).

    Fatal error: Cannot instantiate non-existent class: xtemplate in /var/www/[...]/modules/Studio/parsers/StudioParser.php on line 405

    Sugar: 4.5.0f (Pro)
    PHP: 4.3.10

    Anybody else here who has seen this error?
    Last edited by simple; 2006-11-17 at 07:34 PM.
    Cheers Pascal
    Simplicity GmbH

  2. #2
    sadek's Avatar
    sadek is offline Sugar Team Member
    Join Date
    Sep 2005
    Posts
    244

    Default Re: StudioParser.php non-existing class xtemplate

    I've never seen that before and I could not reproduce the problem. However, I did notice you are running PHP 4.3.10, which is no longer supported in SugarCRM 4.5.0. The recommended version of PHP is 4.4.2, although 5.1.4 seems to be popular as well.

    Might want to consider upgrading PHP to eliminate that possibility. Otherwise, you could end up going down the rabbit hole.
    Sadek Baroudi
    Software Engineer
    SugarCRM

  3. #3
    sadek's Avatar
    sadek is offline Sugar Team Member
    Join Date
    Sep 2005
    Posts
    244

    Default Re: StudioParser.php non-existing class xtemplate

    Quote Originally Posted by simple
    Fatal error: Cannot instantiate non-existent class: xtemplate in /[path_to_webroot]/sugar/modules/Studio/parsers/StudioParser.php on line 405
    Also, wanted to ask what it says on line 405 of StudioParser.php?

    It should be:
    Code:
    $temp_xtpl = new XTemplate($file);
    That X and T in XTemplate must be capitalized, or the class will not be found, which would cause that PHP fatal error.
    Last edited by sadek; 2006-11-21 at 09:49 PM. Reason: Removing user path to webroot from Fatal error message
    Sadek Baroudi
    Software Engineer
    SugarCRM

  4. #4
    simple is offline Sugar Community Member
    Join Date
    Jul 2005
    Posts
    259

    Default Re: StudioParser.php non-existing class xtemplate

    Hi Sadek

    thank you for your fast response. Hmm, if our php version is not supported anymore I'll have to (dist-)upgrade soon.

    At line 405 the 'X' is capitalized. It's the same as you wrote. At the moment I was able to fix it by adding require_once('XTemplate/xtpl.php');

    Where should the xtpl.php be included? I'd like to find out why there is a problem with our php version. We didn't notice any other problems so far.

    Thanks again for your help.
    Cheers Pascal
    Simplicity GmbH

  5. #5
    sadek's Avatar
    sadek is offline Sugar Team Member
    Join Date
    Sep 2005
    Posts
    244

    Default Re: StudioParser.php non-existing class xtemplate

    It's included in A LOT of places in the application, but it exists in the following location, which is included on every page load:
    Code:
    ./data/SugarBean.php:           require_once("XTemplate/xtpl.php");
    If putting in the require_once resolves your issue, that's great! I'd keep that line in there and upgrade PHP when you get a chance. If after upgrading PHP and removing that line that you added, it is still broken, then let us know and I'll see if I can give you any other tips.
    Sadek Baroudi
    Software Engineer
    SugarCRM

Thread Information

Users Browsing this Thread

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

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
  •