File in extension lib path isnt' parsed

Hi,

I created an User_Vendor.pm file where I overwrite the ValidatePassword
method. It is installed under:
/opt/rt4/local/plugins/RT-Extension-NetCologne/lib/RT/
but the file isn’t parsed.
If I copy the User_Vendor.pm file to
/opt/rt4/local/lib/RT/
the file is parsed.

I have Set(@Plugins, qw(RT::Extension::NetCologne)); in my
RT_SiteConfig.pm, cleaned the mason cache and restartet apache.
There is nothing in the logs.

Any ideas why the file isn’t parsed if it is in the extension lib path?

I use currently RT 4.0.7rc1.
This isn’t a regression as I also noticed the problem in RT version
before 4.0.7rc1.
In RT 3.8 series everything was fine.

Chris

Christian Loos
Network Documentation & Fibre Management
NETCOLOGNE Gesellschaft für Telekommunikation mbH
Am Coloneum 9 | 50829 Köln
Tel: 0221 2222-276 | Fax: 0221 2222-7276 | Mobil: 0177 8888276

Geschäftsführer:
Dr. Hans Konle (Sprecher)
Dipl.-Ing. Karl-Heinz Zankel
Vorsitzender des Aufsichtsrates:
Dr. Andreas Cerbe
HRB 25580, AG Köln

Diese Nachricht (inklusive aller Anhänge) ist vertraulich. Sollten Sie diese Nachricht versehentlich erhalten haben, bitten wir, den Absender (durch Antwort-E-Mail) hiervon unverzüglich zu informieren und die Nachricht zu löschen. Die E-Mail darf in diesem Fall weder vervielfältigt noch in anderer Weise verwendet werden.

It was my fault.
I just thought that I have cleaned the mason cache but did not really.
rm -rf /opt/rt4/var/mason_data/obj/* didn’t removed the cache.

Chris

Christian Loos
Network Documentation & Fibre Management
NETCOLOGNE Gesellschaft für Telekommunikation mbH
Am Coloneum 9 | 50829 Köln
Tel: 0221 2222-276 | Fax: 0221 2222-7276 | Mobil: 0177 8888276

Geschäftsführer:
Dr. Hans Konle (Sprecher)
Dipl.-Ing. Karl-Heinz Zankel
Vorsitzender des Aufsichtsrates:
Dr. Andreas Cerbe
HRB 25580, AG Köln

Diese Nachricht (inklusive aller Anhänge) ist vertraulich. Sollten Sie diese Nachricht versehentlich erhalten haben, bitten wir, den Absender (durch Antwort-E-Mail) hiervon unverzüglich zu informieren und die Nachricht zu löschen. Die E-Mail darf in diesem Fall weder vervielfältigt noch in anderer Weise verwendet werden.

OK it’s me again. And the problem is still there.
My User_Vendor.pm under the path
/opt/rt4/local/plugins/RT-Extension-NetCologne/lib/RT/
isn’t parsed but if I copy the same file under
/opt/rt4/local/lib/RT/
the file is parsed.

I now have the devel mode enabled so there is no mason cache involved.

Any ideas?

Chris

OK it’s me again. And the problem is still there.
My User_Vendor.pm under the path
/opt/rt4/local/plugins/RT-Extension-NetCologne/lib/RT/
isn’t parsed but if I copy the same file under
/opt/rt4/local/lib/RT/
the file is parsed.

I now have the devel mode enabled so there is no mason cache involved.

Any ideas?

How are you determining that it’s not parsed? (You haven’t sent the
User_Vendor.pm to the list, so we can’t know.)

How are you determining that it’s not parsed? (You haven’t sent the
User_Vendor.pm to the list, so we can’t know.)

Here is my User_Vendor.pm:

package RT::User;

use strict;
no warnings qw(redefine);

TODO: why this only works in /opt/rt4/local/lib/RT/ and not here

sub _VendorAccessible {
{
WorkPhone => { public => 1 },
MobilePhone => { public => 1 },
Comments => { public => 1 },
}
}

sub ValidatePassword {
my $self = shift;
my $password = shift;

if ( length($password) < RT->Config->Get('MinimumPasswordLength') ) {
    return ( 0, $self->loc("Password needs to be at least [_1]

characters long", RT->Config->Get(‘MinimumPasswordLength’)) );
}

# NOTE: stricter password check
if ( $password !~ /^.*(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).*$/ ) {
    return ( 0, $self->loc("Password must contain lower case

letters, capital letters and numbers") );
}

return 1;

}

1;

The _VendorAccessible part was necessary because I set this in
RT_SiteConfig.pm:
Set($MoreAboutRequestorExtraInfo,“WorkPhone, MobilePhone”);

The password check don’t work and privileged user don’t see WorkPhone
and MobilePhone if the file is in
/opt/rt4/local/plugins/RT-Extension-NetCologne/lib/RT/
but both things work if the file is in
/opt/rt4/local/lib/RT/

Chris

The _VendorAccessible part was necessary because I set this in
RT_SiteConfig.pm: Set($MoreAboutRequestorExtraInfo,“WorkPhone,
MobilePhone”);

The password check don’t work and privileged user don’t see
WorkPhone and MobilePhone if the file is in
/opt/rt4/local/plugins/RT-Extension-NetCologne/lib/RT/ but both
things work if the file is in /opt/rt4/local/lib/RT/

Thanks for the extra info. I tracked this down, and then wrote a fix
and a test for it so that we don’t break it again (it’s happened before).

https://github.com/bestpractical/rt/compare/stable...4.0/plugin-overlays

The actual fix is a single line, see:

https://github.com/bestpractical/rt/commit/aaa2f5b4.patch

The rest is test infrastructure.

The actual fix is a single line, see:

https://github.com/bestpractical/rt/commit/aaa2f5b4.patch

I can confirm that this resolves the bug.
Thanks.

Chris

All,

I am trying to create a top closers list on the default dashboard. I have the exact SQL statment i want to use, but i am lost after that.

select u.Name as User, count(1) as TotalClosedTix from Users u join Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name order by 2 desc limit 10 \G;

*************************** 1. row ***************************
User: winnj
TotalClosedTix: 6
*************************** 2. row ***************************
User: dennisc
TotalClosedTix: 3
*************************** 3. row ***************************
User: royced
TotalClosedTix: 1
3 rows in set (0.00 sec)

What should i be reading to make this happen?

Thanks
Winn Johnston

All,

After following what Andy said, i put my query into the advanced query window. I ran it and it spit out this errorFrom: Andy Jewell Andy.Jewell@sysmicro.co.uk
To: Winn Johnston winn_johnston@yahoo.com
Sent: Thursday, September 6, 2012 2:09 PM
Subject: Re: [rt-devel] Trying to create a custom dashboard screen

The easiest way is to put your search into the normal ticket search ‘advanced’ tab and then save the search. It then appears as an option in your RT-at-a-glance prefs screen.

All,

I am trying to create a top closers list on the default dashboard. I have the exact SQL statment i want to use, but i am lost after that.

select u.Name as User, count(1) as TotalClosedTix from Users u join Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name order by 2 desc limit 10 \G;

*************************** 1. row ***************************
User: winnj
TotalClosedTix: 6
*************************** 2. row ***************************
User: dennisc
TotalClosedTix: 3
*************************** 3. row ***************************
User: royced
TotalClosedTix: 1
3 rows in set (0.00 sec)

What should i be reading to make this happen?

Thanks
Winn Johnston
List info: The rt-devel Archives

All,

After following what Andy said, i put my query into the advanced query window. I ran it and it spit out this error
Wrong query, expecting a OPERATOR in ’ select >u.Name<–here as User, count(1) as TotalClosedTix from Users u join Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name order by 2 desc limit 10;’

Here is the original query.
select u.Name as User, count(1) as TotalClosedTix from Users u join Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name order by 2 desc limit 10;>

Thanks again

winn Johnston

From: Andy Jewell Andy.Jewell@sysmicro.co.uk
To: Winn Johnston winn_johnston@yahoo.com
Sent: Thursday, September 6, 2012 2:09 PM
Subject: Re: [rt-devel] Trying to create a custom dashboard screen

The easiest way is to put your search into the normal ticket search ‘advanced’ tab and then save the search. It then appears as an option in your RT-at-a-glance prefs screen.

All,

I am trying to create a top closers list on the default dashboard. I have the exact SQL statment i want to use, but i am lost after that.

select u.Name as User, count(1) as TotalClosedTix from Users u join Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name order by 2 desc limit 10 \G;

*************************** 1. row ***************************
User: winnj
TotalClosedTix: 6
*************************** 2. row ***************************
User: dennisc
TotalClosedTix: 3
*************************** 3. row ***************************
User: royced
TotalClosedTix: 1
3 rows in set (0.00 sec)

What should i be reading to make this happen?

Thanks
Winn Johnston
List info: The rt-devel Archives

All,

I just verified that i am using the patched 4.0.6 RT version.

I have also verified that this bug fix was in Tree.pm Fix quoting of CF names which contained odder characters · bestpractical/rt@a3b9b97 · GitHub

Still getting the error " Wrong query, expecting a OPERATOR in ’ select >u.Name<–here as User, count(1) as TotalClosedTix from Users u join Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name order by 2 desc limit 10;’ "

When i create an advanced query like
“select u.Name as User, count(1) as TotalClosedTix from Users u join Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name order by 2 desc limit 10;”

Thanks again
-winnFrom: Winn Johnston winn_johnston@yahoo.com
To: “rt-devel@lists.bestpractical.comrt-devel@lists.bestpractical.com
Sent: Tuesday, September 11, 2012 9:04 AM
Subject: Re: [rt-devel] Trying to create a custom dashboard screen

From: Winn Johnston winn_johnston@yahoo.com
To: “rt-devel@lists.bestpractical.comrt-devel@lists.bestpractical.com
Sent: Tuesday, September 11, 2012 9:03 AM
Subject: Re: [rt-devel] Trying to create a custom dashboard screen

All,

After following what Andy said, i put my query into the advanced query window. I ran it and it spit out this error
Wrong query, expecting a OPERATOR in ’ select >u.Name<–here as User, count(1) as TotalClosedTix from Users u join Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name order by 2 desc limit 10;’

Here is the original query.
select u.Name as User, count(1) as TotalClosedTix from Users u join Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name order by 2 desc limit 10;

Thanks again

winn Johnston

From: Andy Jewell Andy.Jewell@sysmicro.co.uk
To: Winn Johnston winn_johnston@yahoo.com
Sent: Thursday, September 6, 2012 2:09 PM
Subject: Re: [rt-devel] Trying to create a custom dashboard screen

The easiest way is to put your search into the normal ticket search ‘advanced’ tab and then save the search. It then appears as an option in your RT-at-a-glance prefs screen.

All,

I am trying to create a top closers list on the default dashboard. I have the exact SQL statment i want to use, but i am lost after that.

select u.Name as User, count(1) as TotalClosedTix from Users u join Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name order by 2 desc limit 10 \G;

*************************** 1. row ***************************
User: winnj
TotalClosedTix: 6
*************************** 2. row ***************************
User: dennisc
TotalClosedTix: 3
*************************** 3. row ***************************
User: royced
TotalClosedTix: 1
3 rows in set (0.00 sec)

What should i be reading to make this happen?

Thanks
Winn Johnston
List info: The rt-devel Archives

Final RT training for 2012 in Atlanta, GA - October 23 & 24
http://bestpractical.com/training

We’re hiring! Careers — Best Practical Solutions

All,

I just verified that i am using the patched 4.0.6 RT version.

I have also verified that this bug fix was in
Tree.pm Fix quoting of CF names which contained odder characters · bestpractical/rt@a3b9b97 · GitHub

This commit has nothing to do with your problem.

Still getting the error " Wrong query, expecting a OPERATOR in ’ select

u.Name<–here as User, count(1) as TotalClosedTix from Users u join
Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name
order by 2 desc limit 10;’ "

When i create an advanced query like
“select u.Name as User, count(1) as TotalClosedTix from Users u join
Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name
order by 2 desc limit 10;”

As I said in my original response
http://lists.bestpractical.com/pipermail/rt-users/2012-September/077837.html
you can’t run raw SQL from RT. You only get to use TicketSQL.

My coworker Ruslan also offered you another suggested solution.

Ahh got it thanks, I don’t know how i missed that reply.

Thanks again
-winnFrom: Thomas Sibley trs@bestpractical.com
To: rt-devel@lists.bestpractical.com
Sent: Tuesday, September 11, 2012 10:17 AM
Subject: Re: [rt-devel] Trying to create a custom dashboard screen

All,

I just verified that i am using the patched 4.0.6 RT version.

I have also verified that this bug fix was in
Tree.pm Fix quoting of CF names which contained odder characters · bestpractical/rt@a3b9b97 · GitHub

This commit has nothing to do with your problem.

Still getting the error " Wrong query, expecting a OPERATOR in ’ select

u.Name<–here as User, count(1) as TotalClosedTix from Users u join
Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name
order by 2 desc limit 10;’ "

When i create an advanced query like
“select u.Name as User, count(1) as TotalClosedTix from Users u join
Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name
order by 2 desc limit 10;”

As I said in my original response
http://lists.bestpractical.com/pipermail/rt-users/2012-September/077837.html
you can’t run raw SQL from RT. You only get to use TicketSQL.

My coworker Ruslan also offered you another suggested solution.

Final RT training for 2012 in Atlanta, GA - October 23 & 24
http://bestpractical.com/training

We’re hiring! Careers — Best Practical Solutions

Awesome,

So i got the chat crated, and i can add it to my custom dashboard. But when i try to add it to the RT At a Glance page i don’t see it in the list of avaialble options.

What am i doing wrong? I asked google with “how to add chart to rt at a glance”

Thanks again
-winnFrom: Winn Johnston winn_johnston@yahoo.com
To: Thomas Sibley trs@bestpractical.com; “rt-devel@lists.bestpractical.comrt-devel@lists.bestpractical.com
Sent: Tuesday, September 11, 2012 10:26 AM
Subject: Re: [rt-devel] Trying to create a custom dashboard screen

Ahh got it thanks, I don’t know how i missed that reply.

Thanks again
-winn

From: Thomas Sibley trs@bestpractical.com
To: rt-devel@lists.bestpractical.com
Sent: Tuesday, September 11, 2012 10:17 AM
Subject: Re: [rt-devel] Trying to create a custom dashboard screen

All,

I just verified that i am using the patched 4.0.6 RT version.

I have also verified that this bug fix was in
Tree.pm Fix quoting of CF names which contained odder characters · bestpractical/rt@a3b9b97 · GitHub

This commit has nothing to do with your problem.

Still getting the error " Wrong query, expecting a OPERATOR in ’ select

u.Name<–here as User, count(1) as TotalClosedTix from Users u join
Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name
order by 2 desc limit 10;’ "

When i create an advanced query like
“select u.Name as User, count(1) as TotalClosedTix from Users u join
Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name
order by 2 desc limit 10;”

As I said in my original response
http://lists.bestpractical.com/pipermail/rt-users/2012-September/077837.html
you can’t run raw SQL from RT. You only get to use TicketSQL.

My coworker Ruslan also offered you another suggested solution.

Final RT training for 2012 in Atlanta, GA - October 23 & 24
http://bestpractical.com/training

We’re hiring! Careers — Best Practical Solutions

Final RT training for 2012 in Atlanta, GA - October 23 & 24
http://bestpractical.com/training

We’re hiring! Careers — Best Practical Solutions

Got it,

Had to create it as root, then edit the at a glance page.

-winnFrom: Winn Johnston winn_johnston@yahoo.com
To: “rt-devel@lists.bestpractical.comrt-devel@lists.bestpractical.com
Sent: Friday, October 12, 2012 10:04 AM
Subject: Re: [rt-devel] Trying to create a custom dashboard screen

Awesome,

So i got the chat crated, and i can add it to my custom dashboard. But when i try to add it to the RT At a Glance page i don’t see it in the list of avaialble options.

What am i doing wrong? I asked google with “how to add chart to rt at a glance”

Thanks again
-winn

From: Winn Johnston winn_johnston@yahoo.com
To: Thomas Sibley trs@bestpractical.com; “rt-devel@lists.bestpractical.comrt-devel@lists.bestpractical.com
Sent: Tuesday, September 11, 2012 10:26 AM
Subject: Re: [rt-devel] Trying to create a custom dashboard screen

Ahh got it thanks, I don’t know how i missed that reply.

Thanks again
-winn

From: Thomas Sibley trs@bestpractical.com
To: rt-devel@lists.bestpractical.com
Sent: Tuesday, September 11, 2012 10:17 AM
Subject: Re: [rt-devel] Trying to create a custom dashboard screen

All,

I just verified that i am using the patched 4.0.6 RT version.

I have also verified that this bug fix was in
Tree.pm Fix quoting of CF names which contained odder characters · bestpractical/rt@a3b9b97 · GitHub

This commit has nothing to do with your problem.

Still getting the error " Wrong query, expecting a OPERATOR in ’ select

u.Name<–here as User, count(1) as TotalClosedTix
from Users u join
Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name
order by 2 desc limit 10;’ "

When i create an advanced query like
“select u.Name as User, count(1) as TotalClosedTix from Users u join
Tickets t on u.id = t.owner where t.Status = “resolved” group by u.Name
order by 2 desc limit 10;”

As I said in my original response
http://lists.bestpractical.com/pipermail/rt-users/2012-September/077837.html
you can’t run raw SQL from RT. You only get to use TicketSQL.

My coworker Ruslan also offered you another suggested solution.

Final RT training for 2012 in Atlanta, GA - October 23 & 24
http://bestpractical.com/training

We’re hiring! Careers — Best Practical Solutions

Final RT training for 2012 in Atlanta, GA - October 23 & 24
http://bestpractical.com/training

We’re hiring! Careers — Best Practical Solutions

Final RT training for 2012 in Atlanta, GA - October 23 & 24
http://bestpractical.com/training

We’re hiring! Careers — Best Practical Solutions