1
AHLIS
Liaise 1.27 and Xoops 2.3.0 RC2
  • 2008/9/7 18:32

  • AHLIS

  • Not too shy to talk

  • Posts: 189

  • Since: 2004/12/12


Hi!

I'm testing XOOPS 2.3.0 RC2 and has just installed Liaise 1.27 and when I press the send button I recive a new page with this text:

Errors
Failed opening template file.


If I go to the adminpage I see this text:
Version of XOOPS does not meet the system requirement. Liaise may not work properly.

Anyone knows how to fix this?
____________
Best Regards
Ahlis

2
Anonymous
Re: Liaise 1.27 and Xoops 2.3.0 RC2
  • 2008/9/7 20:06

  • Anonymous

  • Posts: 0

  • Since:


I'm interested in this too..... good post

What happens when you try with php debugging turned on, i.e. are there any error messages?

Cheers

3
trabis
Re: Liaise 1.27 and Xoops 2.3.0 RC2
  • 2008/9/7 20:19

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


If you look in liaise/admin/footer.php you will see that liaise is expecting to find XOOPS 2.0.9 (at least in liase 1.23)

4
Anonymous
Re: Liaise 1.27 and Xoops 2.3.0 RC2
  • 2008/9/7 20:33

  • Anonymous

  • Posts: 0

  • Since:


Quote:
trabis wrote:

If you look in liaise/admin/footer.php you will see that liaise is expecting to find XOOPS 2.0.9 (at least in liase 1.23)


Interesting..... in Liaise v1.26, line 42 of footer.php says:

$version_check preg_match('/2.0.[9|10|11|12|13]/'XOOPS_VERSION);


Interestingly, it works fine with XOOPS 2.0.18.2.

Presumably, changing the code to something like that below would sort out the Admin message?:

$version_check preg_match('/2.3.[0|1|2|3|4]/'XOOPS_VERSION);


What about the template issue, though?

5
trabis
Re: Liaise 1.27 and Xoops 2.3.0 RC2
  • 2008/9/7 21:09

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


For what I can see there is a bug in XOOPS 2.3 and you need to do some changes in liaise also.

in liaise include/form_execute (around line 184 for liaise 1.26)
you will find:
if( is_dir(LIAISE_ROOT_PATH."language/".$xoopsConfig['language']."/mail_template") ){
    
$template_dir LIAISE_ROOT_PATH."language/".$xoopsConfig['language']."/mail_template";
}else{
    
$template_dir LIAISE_ROOT_PATH."language/english/mail_template";
}

$xoopsMailer =& getMailer();
$xoopsMailer->setTemplateDir($template_dir);


relpace by this:
$xoopsMailer =& xoops_getMailer();
$xoopsMailer->setTemplateDir('liaise');


And thenyou need to fix the core bug in class/xoopsmailer.php line 180:
$path XOOPS "/modules/" $path "/languages/";

Replace by
$path XOOPS_ROOT_PATH "/modules/" $path "/language/";

6
ghia
Re: Liaise 1.27 and Xoops 2.3.0 RC2
  • 2008/9/7 21:35

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
n liaise include/form_execute (around line 184 for liaise 1.26)
you will find:

if( is_dir(LIAISE_ROOT_PATH."language/".$xoopsConfig['language']."/mail_template") ){
    
$template_dir LIAISE_ROOT_PATH."language/".$xoopsConfig['language']."/mail_template";
}else{
    
$template_dir LIAISE_ROOT_PATH."language/english/mail_template";
}

$xoopsMailer =& getMailer();
$xoopsMailer->setTemplateDir($template_dir);
relpace by this:

$xoopsMailer =& xoops_getMailer();
$xoopsMailer->setTemplateDir('liaise');


I think you are breaking a standard here and compatibility with a lot of modules.
This problem has to be resolved entirely in phpmailer, so that it is ready to accept this kind of template specifications.

This is a code snippet from 2.2.6rc
// public
    
function setTemplateDir($value)
    {
        if ( 
substr($value, -11) != "/" ) {
            
$value .= "/";
        }
        
$this->templatedir $value;
    }

    
// public
    
function setTemplate($value)
    {
        
$this->template $value;
    }


// public
    
function send($debug false)
    {
        global 
$xoopsConfig;
        if ( 
$this->body == "" && $this->template == "" ) {
            if (
$debug) {
                
$this->errors[] = _MAIL_MSGBODY;
            }
            return 
false;
        } elseif ( 
$this->template != "" ) {
            
$path = ( $this->templatedir != "" ) ? $this->templatedir."".$this->template : (XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/mail_template/".$this->template);
            if ( !(
$fd = @fopen($path'r')) ) {
                if (
$debug) {
                    
$this->errors[] = _MAIL_FAILOPTPL;
                }
                        return 
false;
                }
            
$this->setBody(fread($fdfilesize($path)));
        }

        
// for sending mail only

7
trabis
Re: Liaise 1.27 and Xoops 2.3.0 RC2
  • 2008/9/7 21:51

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I agree. xoopsmailer needs to be reviewed to maintain compatibility. As it is, you do not even need to set a template dir and as you are forced to use mail_template.

// private
    
function getTemplatePath()
    {
        if (!
$path $this->templatedir) {
            
$path XOOPS_ROOT_PATH "/language/";
        } elseif ( 
false === strpos($path'/') ) {
            
$path XOOPS "/modules/" $path "/languages/";
        } elseif ( 
substr($path, -11) != "/" ) {
            
$path .= "/";
        }
        if (
file_exists($path $GLOBALS['xoopsConfig']['language'] . "/" $this->template) ) {
            return 
$path $GLOBALS['xoopsConfig']['language'] . "/mail_template/" $this->template;
        } else {
            return 
$path "english/mail_template/" $this->template;
        }
    }


// public
    
function send($debug false)
    {
        global 
$xoopsConfig;
        if ( 
$this->body == "" && $this->template == "" ) {
            if (
$debug) {
                
$this->errors[] = _MAIL_MSGBODY;
            }
            return 
false;
        } elseif ( 
$this->template != "" ) {
            
$path $this->getTemplatePath();
            if ( !(
$fd = @fopen($path'r')) ) {
                if (
$debug) {
                    
$this->errors[] = _MAIL_FAILOPTPL;
                }
                return 
false;
            }
            
$this->setBody(fread($fdfilesize($path)));
        }
...

8
trabis
Re: Liaise 1.27 and Xoops 2.3.0 RC2
  • 2008/9/7 21:57

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I guess this would be a better fix for xoopsmailer.php

function getTemplatePath()
    {
        if (!
$path $this->templatedir) {
            
$path XOOPS_ROOT_PATH "/language/";
        } elseif ( 
false === strpos($path'/') ) {
            
$path XOOPS_ROOT_PATH "/modules/" $path "/language/";
        } elseif ( 
substr($path, -11) != "/" ) {
            
$path .= "/";
        }
        
        if (
file_exists($path $GLOBALS['xoopsConfig']['language'] . "/mail_template/" $this->template) ) {
            return 
$path $GLOBALS['xoopsConfig']['language'] . "/mail_template/" $this->template;
        } elseif (
file_exists($path "english/mail_template/" $this->template) ) {
            return 
$path "english/mail_template/" $this->template;
        } elseif (
file_exists($path $this->template) ) {
            return 
$path $this->template;
        } else {
            return 
false;
        }
    }

9
AHLIS
Re: Liaise 1.27 and Xoops 2.3.0 RC2
  • 2008/9/8 16:53

  • AHLIS

  • Not too shy to talk

  • Posts: 189

  • Since: 2004/12/12


Quote:

trabis wrote:
I guess this would be a better fix for xoopsmailer.php

function getTemplatePath()
    {
        if (!
$path $this->templatedir) {
            
$path XOOPS_ROOT_PATH "/language/";
        } elseif ( 
false === strpos($path'/') ) {
            
$path XOOPS_ROOT_PATH "/modules/" $path "/language/";
        } elseif ( 
substr($path, -11) != "/" ) {
            
$path .= "/";
        }
        
        if (
file_exists($path $GLOBALS['xoopsConfig']['language'] . "/mail_template/" $this->template) ) {
            return 
$path $GLOBALS['xoopsConfig']['language'] . "/mail_template/" $this->template;
        } elseif (
file_exists($path "english/mail_template/" $this->template) ) {
            return 
$path "english/mail_template/" $this->template;
        } elseif (
file_exists($path $this->template) ) {
            return 
$path $this->template;
        } else {
            return 
false;
        }
    }


Thanks. The above code helped. :)
____________
Best Regards
Ahlis

10
Anonymous
Re: Liaise 1.27 and Xoops 2.3.0 RC2
  • 2008/9/8 17:08

  • Anonymous

  • Posts: 0

  • Since:


Thread bookmarked

Login

Who's Online

374 user(s) are online (232 user(s) are browsing Support Forums)


Members: 0


Guests: 374


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits