I got a fatal error when I tried the global var of the last post. But Jason told me rapidly in a private message what was missing in the var. So, we should use instead this:
my ($user_id, $prefix) = @_;
$prefix ||= "";
my $user = $DB->table('User')->get($user_id) or return;
require GForum::User;
GForum::User::normalize($user);
my $return = {};
for (keys %$user) { $return->{$prefix . $_} = $user->{$_} }
$return;
}
This solution works perfectly! Thank you to Jason! I'm still always impressed by the high quality of your support!
François
Code:
sub { my ($user_id, $prefix) = @_;
$prefix ||= "";
my $user = $DB->table('User')->get($user_id) or return;
require GForum::User;
GForum::User::normalize($user);
my $return = {};
for (keys %$user) { $return->{$prefix . $_} = $user->{$_} }
$return;
}
This solution works perfectly! Thank you to Jason! I'm still always impressed by the high quality of your support!
François