How to customize in local/lib

Hi,
Sorry if this have been asked before, but I could n’t see anything in the archives or via web search.

I just started the process of upgrading my rt-3.8.7 to rt-4
With rt-4 the Overlay files have been removed, and I am wondering what is the proper way to add or modify existing functions with lib/RT.
For example to change a subroutine in User_Overlay.pm in 3.8.7 , I create User_Vendor.pm in local/lib/RT , copy then modify the function I need to change into
User_Vendor.pm , similar any new functions I need go there ?? will this method still work in 4.0.8 ?? or Do I need the whole of User.pm then modify or add to ??

Roy

[cid:image07daee.PNG@729b4329.40a8e0b6]

This email (and any attachments) contains information, which may be privileged and/or confidential. It’s meant only for the individual(s) or entity named above. If you’re not the intended recipient, please note that disclosing, copying, distributing or using this information is prohibited. If you’ve received this email in error, please let me know immediately by emailing me at the email address above and then delete all traces of this email from your system. We monitor our email system, and may record your emails.

Computer viruses can be transmitted by email. You should check this email and any attachments for the presence of viruses. We accept no liability for any damage caused by any virus transmitted by this email or any attachments.

Daisy Communications Ltd
Registered office: Daisy House, Lindred Road Business Park, Nelson, Lancashire, BB9 5SR
Registered in England and Wales with company number: 4145329

Hi,

Sorry if this have been asked before, but I could n’t see anything in
the archives or via web search.

I just started the process of upgrading my rt-3.8.7 to rt-4

With rt-4 the Overlay files have been removed, and I am wondering what
is the proper way to add or modify existing functions with lib/RT.

For example to change a subroutine in User_Overlay.pm in 3.8.7 , I
create User_Vendor.pm in local/lib/RT , copy then modify the function I
need to change into

User_Vendor.pm , similar any new functions I need go there ?? will this
method still work in 4.0.8 ?? or Do I need the whole of User.pm then
modify or add to ??

The same method you’re using will still work; the _Overlay.pm files were
merged with the standard .pm files.

(FWIW, we’ve always suggested not using _Vendor as that may be used by,
well, the vendor (that’s usually us, when writing extensions), so _Local
is preferable for your local changes.)

Thanks Thomas, I will use Local from now on … Is Tickets.pm an
exception though?? Just tried moving local/lib/RT/Tickets.pm to
local/lib/RT/Tickets_Local.pm , I copied over the whole module and
modified adding to '%FIELD_METADATA ’ and to ‘our %dispatch’ and a
function that I need, and now none of the searches work , including
the home page, I get error:

The ‘message’ parameter ("Unknown field ‘UserQueueOp’ in ‘Status !=
‘resolved’ AND Status != ‘completed’ AND UserQueueOp LIKE
CurrentUser’’ at /opt/rt4/sbin/…/lib/RT/Tickets_SQL.pm line
200.

If I keep it as local/lib/RT/Tickets.pm , all works ok ??

Please keep messages on the list.

No, there isn’t an exception for Tickets.pm. Please show the code
you’re using, otherwise we can only guess.

Copying an entire .pm is really wrong.

Need to remember reply all.
Attached is my Tickets_Local.pm, please note my changes are commented by " Added by Daisy"

UserQueues is a table that populates once a day --via cron-- with id,Uid and Qid ; Uid being a user id and Qid is a queue id that a user is directly an Admin Cc on.
Using factory I created UserQueue.pm and UserQueues.pm , I can attach them for you, but really there is nothing effecting this in them.

-If you wondering why, we have many queues with many users , and _UserQueueLimit used to build a list of active tickets that a user is admin Cc on, doing it this way avoids having to build a join with Groups/GroupMembers/CachedGroupMembers etc , the page associated with the search have an average refresh of 2 minutes, for around 50 support users so needed a quicker more efficient alternative to the typical search join.

Copying an entire .pm is really wrong.
I know , hence my question :slight_smile:

Appreciate your help, and looking forward to your advice.

Roy

Visit our website today www.daisygroupplc.com

Registered Office: Daisy House, Lindred Road Business Park, Nelson, Lancashire BB9 5SR
Company Registration Number: 4145329 | VAT Number: 722471355
Daisy Communications Limited is a company registered in England and Wales.
DISCLAIMER

This email (including any attachments) is strictly confidential and may also be legally privileged. If the recipient has received this email in error please notify the sender and do not read, print, re-transmit, store or act in reliance on the email or its attachments and immediately delete this email and its attachments from the recipient’s system. Daisy Communications Limited cannot accept liability for any breaches of confidence arising through use of email. Employees of Daisy Communications Limited are expressly required not to make any defamatory statements and not to infringe or authorise any infringement of copyright or any other legal right by email communications. Any such communication is contrary to the company’s policy and outside the scope of the employment of the individual concerned. Daisy Communications Limited will not accept any liability in respect of such a communication, and the employee responsible will be personally liable for any damages or other liability arising.

If you are the intended recipient of this email please ensure that neither the email nor any attachments are copied to third parties outside your organisation or saved without the written permission of the sender. In the event of any unauthorised copying or forwarding, the recipient will be required to indemnify Daisy Communications Limited against any claim for loss or damage caused by any viruses or otherwise.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses. Daisy Communications Limited accepts no liability for any damage caused by any virus transmitted by this email or any attachments.
NOTICE TO CUSTOMERS
If you have ordered a telephone number from Daisy Communications Limited (non-geographic or new line installation) please do NOT arrange for any form of advertising until the number is live and tested.-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Thomas Sibley
Sent: 31 January 2013 17:42
To: RT Users
Subject: Re: [rt-users] How to customize in local/lib

On 01/31/2013 09:36 AM, Raed El-Hames wrote:

Thanks Thomas, I will use Local from now on … Is Tickets.pm an
exception though?? Just tried moving local/lib/RT/Tickets.pm to
local/lib/RT/Tickets_Local.pm , I copied over the whole module and
modified adding to '%FIELD_METADATA ’ and to ‘our %dispatch’ and a
function that I need, and now none of the searches work , including
the home page, I get error:

The ‘message’ parameter ("Unknown field ‘UserQueueOp’ in ‘Status !=
‘resolved’ AND Status != ‘completed’ AND UserQueueOp LIKE
CurrentUser’’ at /opt/rt4/sbin/…/lib/RT/Tickets_SQL.pm line 200.

If I keep it as local/lib/RT/Tickets.pm , all works ok ??

Please keep messages on the list.

No, there isn’t an exception for Tickets.pm. Please show the code you’re using, otherwise we can only guess.

Copying an entire .pm is really wrong.

Tickets_Local.pm.txt (97.2 KB)

Any advice on this , Thomas or anyone ??

Roy

Visit our website today www.daisygroupplc.com

Registered Office: Daisy House, Lindred Road Business Park, Nelson, Lancashire BB9 5SR
Company Registration Number: 4145329 | VAT Number: 722471355
Daisy Communications Limited is a company registered in England and Wales.
DISCLAIMER

This email (including any attachments) is strictly confidential and may also be legally privileged. If the recipient has received this email in error please notify the sender and do not read, print, re-transmit, store or act in reliance on the email or its attachments and immediately delete this email and its attachments from the recipient’s system. Daisy Communications Limited cannot accept liability for any breaches of confidence arising through use of email. Employees of Daisy Communications Limited are expressly required not to make any defamatory statements and not to infringe or authorise any infringement of copyright or any other legal right by email communications. Any such communication is contrary to the company’s policy and outside the scope of the employment of the individual concerned. Daisy Communications Limited will not accept any liability in respect of such a communication, and the employee responsible will be personally liable for any damages or other liability arising.

If you are the intended recipient of this email please ensure that neither the email nor any attachments are copied to third parties outside your organisation or saved without the written permission of the sender. In the event of any unauthorised copying or forwarding, the recipient will be required to indemnify Daisy Communications Limited against any claim for loss or damage caused by any viruses or otherwise.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses. Daisy Communications Limited accepts no liability for any damage caused by any virus transmitted by this email or any attachments.
NOTICE TO CUSTOMERS
If you have ordered a telephone number from Daisy Communications Limited (non-geographic or new line installation) please do NOT arrange for any form of advertising until the number is live and tested.From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Raed El-Hames
Sent: 31 January 2013 18:05
To: Thomas Sibley; RT Users
Subject: Re: [rt-users] How to customize in local/lib

Need to remember reply all.
Attached is my Tickets_Local.pm, please note my changes are commented by " Added by Daisy"

UserQueues is a table that populates once a day --via cron-- with id,Uid and Qid ; Uid being a user id and Qid is a queue id that a user is directly an Admin Cc on.
Using factory I created UserQueue.pm and UserQueues.pm , I can attach them for you, but really there is nothing effecting this in them.

-If you wondering why, we have many queues with many users , and _UserQueueLimit used to build a list of active tickets that a user is admin Cc on, doing it this way avoids having to build a join with Groups/GroupMembers/CachedGroupMembers etc , the page associated with the search have an average refresh of 2 minutes, for around 50 support users so needed a quicker more efficient alternative to the typical search join.

Copying an entire .pm is really wrong.
I know , hence my question :slight_smile:

Appreciate your help, and looking forward to your advice.

Roy

Visit our website today www.daisygroupplc.com

Registered Office: Daisy House, Lindred Road Business Park, Nelson, Lancashire BB9 5SR
Company Registration Number: 4145329 | VAT Number: 722471355
Daisy Communications Limited is a company registered in England and Wales.
DISCLAIMER

This email (including any attachments) is strictly confidential and may also be legally privileged. If the recipient has received this email in error please notify the sender and do not read, print, re-transmit, store or act in reliance on the email or its attachments and immediately delete this email and its attachments from the recipient’s system. Daisy Communications Limited cannot accept liability for any breaches of confidence arising through use of email. Employees of Daisy Communications Limited are expressly required not to make any defamatory statements and not to infringe or authorise any infringement of copyright or any other legal right by email communications. Any such communication is contrary to the company’s policy and outside the scope of the employment of the individual concerned. Daisy Communications Limited will not accept any liability in respect of such a communication, and the employee responsible will be personally liable for any damages or other liability arising.

If you are the intended recipient of this email please ensure that neither the email nor any attachments are copied to third parties outside your organisation or saved without the written permission of the sender. In the event of any unauthorised copying or forwarding, the recipient will be required to indemnify Daisy Communications Limited against any claim for loss or damage caused by any viruses or otherwise.

WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses. Daisy Communications Limited accepts no liability for any damage caused by any virus transmitted by this email or any attachments.
NOTICE TO CUSTOMERS
If you have ordered a telephone number from Daisy Communications Limited (non-geographic or new line installation) please do NOT arrange for any form of advertising until the number is live and tested.