developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 11 years ago

Closed 11 years ago

#897 closed bug (fixed)

Jelix locales error when using jMailer

Reported by: laurentj Owned by: bballizlife
Priority: normal Milestone: Jelix 1.1.3
Component: jelix:utils Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

In jMailer, there are bad arguments given to jException in the SetError? method.

And then this error is generated:

[exception 200] The given locale key "jelix~errors.mail.instantiate" is invalid (for charset UTF-8, lang UTF-8)

Instead of the real error.

Attachments (1)

897-1.diff (1.4 KB) - added by bballizlife 11 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 11 years ago by laurentj

  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from Jelix error when using jMailer to Jelix locales error when using jMailer

fixed in r1381

comment:2 Changed 11 years ago by foxmask

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 1.1 to trunk

I have this error with the trunk version :/ with the exactly same error message.

comment:3 Changed 11 years ago by foxmask

je suis dsol je ne peux que t'apporter la solution sous cette forme, ne disposant pas de svn d'ici pour te fournir un patch

l'erreur est ligne 178 182 de jMailer.class.php :

            if ($arg !== null) {
                throw new jException($locale, $arg, $this->lang, $this->CharSet);
            }
            else
                throw new jException($locale, array(), $this->lang, $this->CharSet);

l'ordre des arguments n'est pas en correspondance avec la signature de la methode jException qui elle attend 5 paramtres et surtout le 3 ieme est le code ; non la langue

on devrait donc avoir minima :

            if ($arg !== null) {
                throw new jException($locale, $arg, 1, $this->lang, $this->CharSet);
            }
            else
                throw new jException($locale, array(), 1, $this->lang, $this->CharSet);

car la mthode est :

public function __construct($localekey, $localeParams = array(), $code = 1, $lang = null, $charset = null) {

cordialement.

Changed 11 years ago by bballizlife

comment:4 Changed 11 years ago by bballizlife

  • Owner set to bballizlife
  • Status changed from reopened to new

Here is a first patch. Indeed the error code was missing. I set it to 1 for both exceptions but i guess we should give specific error codes.

Can't remember how we choose error codes ;)

comment:5 Changed 11 years ago by bballizlife

  • review set to review?
  • Status changed from new to assigned

comment:6 Changed 11 years ago by laurentj

  • review changed from review? to review+

ok for me. Error code : I choose 1 because... 1 is good no ? :-)

patch should be applied on the trunk and 1.1.x

comment:7 Changed 11 years ago by bballizlife

  • Resolution set to fixed
  • Status changed from assigned to closed

commited in trunk and branch 1.1.x in r1416

Note: See TracTickets for help on using tickets.