[Catalyst] Strange data in the Stash

Stephan Austermühle au at hcsd.de
Fri Feb 17 11:01:32 CET 2006


Hi,

sometimes I have data in my Stash that I do not know what it comes from.
First the way when everything is okay:

    'name' => bless( {
        'date' => '2006-02-16 15:05:54',
        'billing_enabled' => '0',
        ...
        'costcenter' => '999999999',
        'customer' => 'xxx',
        'id' => '1',
        'requestor' => 'xxxxxxxx',
        'landscape' => 'Test'
    }, 'App::Model::DB::Table' )

This is resulting from the following statements:

    sub add: Local {
        ...
        $c->stash->{reqno} = $c->request->params->{reqno};
        ...
        $c->forward('editor');
    }

    sub editor: Private {
        ...
        $c->stash->{name} = ${ [
App::Model::DB::Table->search_details($c->stash->{reqno}) ] }[0];
        ...
    }

When retrieving the value for 'reqno' from a database table I have the
following in my Stash

    'name' => $VAR1->{'assignment'}{'reqno'}

instead of the data shown above resulting from

    sub edit: Local {
        ...
        $c->stash->{assignment} =
App::Model::DB::OtherTable->retrieve($c->request->params->{id});
	$c->stash->{reqno} = $c->stash->{assignment}->name->id;
        ...
        $c->forward('editor');
    }

in the Stash. So I get correct data if I assign the Stash var 'reqno' a
string directly and incorrect data if I retrieve the string from the
database.

Can you give me a hint what is going wrong here?

Thanks for your help!

Stephan



More information about the Catalyst mailing list