Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: setMessage #193

Open
bjverde opened this issue Oct 11, 2019 · 2 comments
Open

Bug: setMessage #193

bjverde opened this issue Oct 11, 2019 · 2 comments
Labels
Backend Bug Something isn't working JavaScript

Comments

@bjverde
Copy link
Owner

bjverde commented Oct 11, 2019

usar o setMessage gera um problema travando a tela

@bjverde
Copy link
Owner Author

bjverde commented Oct 11, 2019

Exemplo para reproduzir o problema. Quando é chamada um acao Save que utiliza
$frm->setMessage( $e->getMessage() ); no catch a tela fica travada e não sai.

chamando uma controller com

    public function save( Pessoa_juridicaVO $objVo )
    {
        $tpdo = New TPDOConnectionObj();
        $result = null;
        try{
            $tpdo->beginTransaction();
            //throw new DomainException('xxx');
            throw new Exception('aaaa');
            $tpdo->commit();            
        }catch (Exception $e) {
            $tpdo->rollBack();
            MessageHelper::logRecord($e);
            throw new Exception($e->getMessage());
        }
        return $result;
        
        /*
        $result = null;
        if( $objVo->getIdpessoa_juridica() ) {
            $result = $this->dao->update( $objVo );
        } else {
            $result = $this->dao->insert( $objVo );
        }
        return $result;
        */
    }

@bjverde
Copy link
Owner Author

bjverde commented Oct 11, 2019

A origem do problema provavelmente a função setMessage não limpar tudo como acontece no addMessage

TForm->setMessage linha 2539
https://github.com/bjverde/formDin/blob/master/base/classes/webform/TForm.class.php#L2539

TForm->addMessage linha 2597
https://github.com/bjverde/formDin/blob/master/base/classes/webform/TForm.class.php#L2597

@bjverde bjverde mentioned this issue Oct 11, 2019
5 tasks
@bjverde bjverde added the Bug Something isn't working label Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Bug Something isn't working JavaScript
Projects
None yet
Development

No branches or pull requests

1 participant