Hi, I'm probably missing something really simple here but I always get the following error:
null: Can't access `list' field in class Emart::Client at (eval 173) line 13
Here's the bit of the HTML that is falling over:
[% FOREACH client = Client.list %]
[% client.name %] <a href="/Emart/Frameset/?[% client.id
%]">Blurb</a><br>
[% END %]
Here is the data structure it is trying to access:
$details = bless( {
'table_data' => 'Users:user_name:user_password',
'Users' => bless( {
'rights' => [],
'email' => '[EMAIL PROTECTED]',
'header' => 'default_header.html',
'user_id' => 1,
'surname' => 'Test',
'_permitted' => {},
'forename' => 'Dummy',
'DBH' => bless( {}, 'Apache::DBI::db' ),
'user' => 'dummy'
}, 'Emart::Users' ),
'db_user' => 'anwill',
'dsn' => 'mysql:ERMS:localhost',
'db_pass' => 'pe175xe',
'_permitted' => {
'db_pass' => 1,
'db_user' => 1,
'dsn' => 1
},
'DBH' => $VAR1->{'Users'}{'DBH'},
'Client' => bless( {
'clientlist' => [
{
'rights' => undef,
'postcode' => undef,
'name' => undef,
'Campaigns' => [
{
'child_id' =>
undef,
'name' =>
undef,
'description'
=> undef,
'end_date' =>
undef,
'status' =>
undef,
'create' =>
undef,
'modify' =>
undef,
'cost' =>
undef,
'user_id' =>
undef,
'start_date'
=> undef,
'owner' =>
undef,
'id' => undef,
'objectives'
=> undef
}
],
'address_1' => undef,
'address_2' => undef,
'address_3' => undef,
'address_4' => undef,
'address_5' => undef,
'id' => undef
}
],
'list' => [
{
'address_3' => '',
'rights' => [
'admin'
],
'postcode' => 'XX1 1XX',
'address_4' => 'Mytown',
'name' => 'My Company',
'address_5' => 'This County',
'id' => 1,
'address_1' => '3 The Street',
'address_2' => 'The Village'
}
],
'_permitted' => {},
'DBH' => $VAR1->{'Users'}{'DBH'},
'user' => 'dummy'
}, 'Emart::Client' ),
'user' => 'dummy'
}, 'Emart::Details' );
If I just pass the Template $details->{Client} and just use the following
HTML it all works!!
[% FOREACH client = list %]
[% client.name %] <a href="/Emart/Frameset/?[% client.id
%]">Campaign Management</a><br>
[% END %]
I just can't figure this out, and it's probably something really silly!
TIA
Andy
