Re: [rt-users] Failed to load dashboard

2014-09-18 Thread Carlos Ramos
Hi Christian,

Thanks a lot, that solved my problem a lot easier than expected. Again
thanks a lot.

Cheers.

On Wed, Sep 17, 2014 at 7:05 AM, Christian Loos cl...@netcologne.de wrote:

 Am 16.09.2014 um 18:56 schrieb Carlos Ramos:
  Hi Christian,
 
  This script is great, I was able to identify the users with a reference
  to that specific dashboard. But I could not find how this information is
  stored in the DB (my best guess is attributes.content which is binary)
  and I really don't know much about the RT API. Do you know if it's
  possible to remove theses invalid references directly in the database?,
  if not, how can I do so through the RT API?
 
  In the RT API there is a DeletePreferences in the RT::User class, but i
  don't see how I can delete a specific DashboardInMenu id from the
  preferences. Any ideas about this?
 
  Thanks a lot for the help.

 On the user modify page (Admin - Users) you can change a users
 Dashboards in menu preference.
 The right select box contains a row without a label for the deleted
 dashboard, select this row and hit Delete.

 Chris




-- 
Carlos Ramos
-- 
RT Training November 4  5 Los Angeles
http://bestpractical.com/training


Re: [rt-users] Failed to load dashboard

2014-09-17 Thread Christian Loos
Am 16.09.2014 um 18:56 schrieb Carlos Ramos:
 Hi Christian,
 
 This script is great, I was able to identify the users with a reference
 to that specific dashboard. But I could not find how this information is
 stored in the DB (my best guess is attributes.content which is binary)
 and I really don't know much about the RT API. Do you know if it's
 possible to remove theses invalid references directly in the database?,
 if not, how can I do so through the RT API?
 
 In the RT API there is a DeletePreferences in the RT::User class, but i
 don't see how I can delete a specific DashboardInMenu id from the
 preferences. Any ideas about this?
 
 Thanks a lot for the help.

On the user modify page (Admin - Users) you can change a users
Dashboards in menu preference.
The right select box contains a row without a label for the deleted
dashboard, select this row and hit Delete.

Chris
-- 
RT Training - Boston, September 9-10
http://bestpractical.com/training


Re: [rt-users] Failed to load dashboard

2014-09-16 Thread Christian Loos
Am 16.09.2014 um 05:13 schrieb Carlos Ramos:
 Hello,
 
 I'm getting the following warning on my Apache error log every time I
 load pretty much every RT page and I would like to get rid of it:
 
 [warning]: Failed to load dashboard 235: Failed to load dashboard 235:
 Couldn't find row (/opt/rt4/share/html/Elements/Tabs:497)
 
 I guess some dashboard was deleted and it's somehow still referenced but
 not showing up in the UI. ¿How can I manually delete this reference?
 
 Thanks.
 
 -- 
 Carlos Ramos

Attached a simple Perl script I use.
The pod also notes the bug report for this.

Chris
#!/usr/bin/env perl

use 5.10.1;
use strict;
use warnings;

### after: use lib qw(@RT_LIB_PATH@);
use lib qw(/opt/rt4/local/lib /opt/rt4/lib);

use RT;
RT-LoadConfig;
RT-Init;

$| = 1;

my %opts;
use Getopt::Long;
GetOptions( \%opts,
help|h,
id=i,
);

$opts{help} = 1
unless $opts{id};

if ($opts{help}) {
use Pod::Usage;
print Pod::Usage::pod2usage(-verbose = 2);
exit;
}

my $Users = RT::Users-new(RT-SystemUser);
$Users-FindAllRows;

while (my $User = $Users-Next) {
my $dashboard_pref = $User-Preferences('DashboardsInMenu');
next unless $dashboard_pref;

my $dashboards = $dashboard_pref-{dashboards} || [];

next unless grep { $opts{id} == $_  } @$dashboards;

print sprintf User %s has Dashboard %d in DashboardsInMenu Preference!\n,
$User-Name,
$opts{id};
}

=head1 NAME

rt-find-dashboardsinmenu - find users with a dashboard in DashboardsInMenu

=head1 SYNOPSIS

rt-find-dashboardsinmenu [options]

=head1 DESCRIPTION

Find users with an given dashboard id in their DashboardsInMenu preference.

=head1 OPTIONS

This script supports a few options.

=over

=item B-h, B--help

Display this documentation

=item B--id

The dashboard id to search for.

=back

=head1 AUTHOR

Christian Loos cl...@netcologne.de

=head1 COPYRIGHT AND LICENCE

Copyright (C) 2014, NetCologne GmbH.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=head1 SEE ALSO

=over

=item Lhttp://issues.bestpractical.com/Ticket/Display.html?id=29719

=back

=cut

1;
-- 
RT Training - Boston, September 9-10
http://bestpractical.com/training

Re: [rt-users] Failed to load dashboard

2014-09-16 Thread Carlos Ramos
Hi Christian,

This script is great, I was able to identify the users with a reference to
that specific dashboard. But I could not find how this information is
stored in the DB (my best guess is attributes.content which is binary) and
I really don't know much about the RT API. Do you know if it's possible to
remove theses invalid references directly in the database?, if not, how can
I do so through the RT API?

In the RT API there is a DeletePreferences in the RT::User class, but i
don't see how I can delete a specific DashboardInMenu id from the
preferences. Any ideas about this?

Thanks a lot for the help.

On Tue, Sep 16, 2014 at 12:07 AM, Christian Loos cl...@netcologne.de
wrote:

 Am 16.09.2014 um 05:13 schrieb Carlos Ramos:
  Hello,
 
  I'm getting the following warning on my Apache error log every time I
  load pretty much every RT page and I would like to get rid of it:
 
  [warning]: Failed to load dashboard 235: Failed to load dashboard 235:
  Couldn't find row (/opt/rt4/share/html/Elements/Tabs:497)
 
  I guess some dashboard was deleted and it's somehow still referenced but
  not showing up in the UI. ¿How can I manually delete this reference?
 
  Thanks.
 
  --
  Carlos Ramos

 Attached a simple Perl script I use.
 The pod also notes the bug report for this.

 Chris




-- 
Carlos Ramos
-- 
RT Training - Boston, September 9-10
http://bestpractical.com/training