Absolutely no problem. Do you want me to do anything with the original ticket?  [rt3 #19056]<div><br></div><div>It seems that these two issues I am experiencing are related to the same underlying issue. I can open a separate ticket for this or update that ticket if you feel it is appropriate. </div>
<div><br><div><br><div class="gmail_quote">On Tue, Mar 13, 2012 at 11:28 AM, Kevin Falcone <span dir="ltr"><<a href="mailto:falcone@bestpractical.com">falcone@bestpractical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, Mar 12, 2012 at 10:47:10PM -0400, Jim Lesinski wrote:<br>
>    Yep. In fact I was just looking at this issue and I traced the error out to line 311 in<br>
>    Principals.pm, which is the section of code below. If I just stick a "return 1;" above that<br>
>    section of code everything works. Coincidentally, I believe that this will also fix another<br>
>    bug I submitted [rt3 #19056] regarding permissions and the autocomplete custom field when not<br>
>    using a custom data source.<br>
>    Anyway, it has something to do with this bit of code about caching but my perl is to newb for<br>
>    a proper fix :)<br>
>    Hope that is helpful.<br>
<br>
</div>Do you mind turning your replication recipe into a real bug report at<br>
rt-bugs @ <a href="http://bestpractical.com" target="_blank">bestpractical.com</a> ?  Mention that you tested the branch and<br>
it didn't help, it sounds like we need some extensions to that branch.<br>
<br>
Thanks for finding some interesting corner cases<br>
<br>
-kevin<br>
<div class="im"><br>
><br>
>  # Construct a hashkeys to cache decisions:<br>
><br>
><br>
>  # 1) full_hashkey - key for any result and for full combination of uid, right and objects<br>
><br>
><br>
>  # 2) short_hashkey - one key for each object to store positive results only, it applies<br>
><br>
><br>
>  # only to direct group rights and partly to role rights<br>
><br>
><br>
</div>>  ****my $full_hashkey = join (";:;", $self->id, $args{'Right'});<br>
><br>
><br>
>  ****foreach ( @{ $args{'EquivObjects'} } ) {<br>
><br>
><br>
>  ********my $ref_id = $self->_ReferenceId($_);<br>
><br>
><br>
>  ********$full_hashkey .= ";:;".$ref_id;<br>
><br>
><br>
><br>
>  ********my $short_hashkey = join(";:;", $self->id, $args{'Right'}, $ref_id);<br>
><br>
><br>
>  ********my $cached_answer = $_ACL_CACHE->fetch($short_hashkey);<br>
><br>
><br>
>  ********return $cached_answer > 0 if defined $cached_answer;<br>
><br>
><br>
>  ****}<br>
><br>
><br>
><br>
>  ****{<br>
><br>
><br>
>  ********my $cached_answer = $_ACL_CACHE->fetch($full_hashkey);<br>
><br>
><br>
>  ********return $cached_answer > 0 if defined $cached_answer;<br>
><br>
><br>
>  ****}<br>
><br>
><br>
><br>
>  ****my ( $hitcount, $via_obj ) = $self->_HasRight(%args);<br>
><br>
><br>
><br>
>  ****$_ACL_CACHE->set( $full_hashkey => $hitcount ? 1 : -1 );<br>
><br>
><br>
>  ****$_ACL_CACHE->set( join(';:;',  $self->id, $args{'Right'},$via_obj) => 1 )<br>
><br>
><br>
>  ********if $via_obj && $hitcount;<br>
><br>
><br>
><br>
>  ****return ($hitcount);<br>
<div><div class="h5">><br>
><br>
>    On Mon, Mar 12, 2012 at 10:22 PM, Kevin Falcone <[1]<a href="mailto:falcone@bestpractical.com">falcone@bestpractical.com</a>> wrote:<br>
><br>
>      On Mon, Mar 12, 2012 at 06:52:00PM -0400, Jim Lesinski wrote:<br>
>      > get the branch name to work because it included a forward slash so I used the commit id...<br>
>      > Maybe someone can chime in?<br>
>      > This didn't work: git format-patch rt-4.0.5..4.0/context-on-custom-fields --stdout ><br>
>      > fields.patch<br>
>      > git format-patch<br>
>      > 94acf9055ccb6a7368d539dcc8f1d2684016e8ef..2b3265a91a4e5e8cdf724ea218ea30fa501f73b2<br>
>      --stdout ><br>
>      > fields.patch<br>
><br>
>      It's not the forward slash, those are absolutely legal, the problem is<br>
>      that you had no local copy of the branch.<br>
><br>
>      git checkout 4.0/context-on-custom-fields<br>
>      git format-patch 4.0-trunk or git format-patch rt-4.0.5<br>
>      will get you the 4 patches (your --stdout > file.patch would work<br>
>      too). Although your incant *should* have created the correct set of<br>
>      files.<br>
><br>
>      After applying the patches, clearing your mason cache and restarting<br>
>      apache, are you still seeing a warning in the debug logs?<br>
><br>
>      -kevin<br>
>      > 5. Change to the RequestTracker install directory<br>
>      > cd /opt/rt4<br>
>      > 6. This shows what changes are in the patch:<br>
>      > git apply --stat /tmp/patch/stable/fields.patch<br>
>      > 7. This allows you to try out the patch:<br>
>      > git apply --check /tmp/patch/stable/fields.patch<br>
>      > 8. And Finally this applies the patch:<br>
>      > git apply -v /tmp/patch/stable/fields.patch<br>
</div></div><div class="im">>      > On Mon, Mar 5, 2012 at 12:11 PM, Kevin Falcone <[2][2]<a href="mailto:falcone@bestpractical.com">falcone@bestpractical.com</a>> wrote:<br>
>      ><br>
>      > On Mon, Mar 05, 2012 at 08:58:40AM -0500, Jim Lesinski wrote:<br>
>      > > I copied over the changed files from the branch you suggested into<br>
>      > > /local/lib/RT/CustomField.pm<br>
>      > > /local/lib/RT/Interface/Web.pm<br>
>      > > /local/lib/RT/Transaction.pm<br>
>      > > Then I cleared the mason cache and restarted apache. I ended up with this error.<br>
>      ><br>
>      > Unfortunately, 4.0/context-on-custom-fields predates some work we did<br>
>      > in 4.0.5, so copying the files will take out code we added later.<br>
>      > You really want to apply patches (or do a local merge of that branch)<br>
>      > rather than trying to pull full files out of it.<br>
>      ><br>
>      > Github will show you what changes you'd need to apply here, but I'm<br>
>      > not sure how to get it to give you a patch file.<br>
>      ><br>
</div>>      > [3][3]<a href="https://github.com/bestpractical/rt/compare/stable...4.0%2Fcontext-on-custom-fields" target="_blank">https://github.com/bestpractical/rt/compare/stable...4.0%2Fcontext-on-custom-fields</a><br>

<div><div class="h5">>      ><br>
>      > -kevin<br>
>      > > error: Undefined subroutine &HTML::Mason::Commands::MaybeRedirectToApproval called at<br>
>      > > /opt/rt4/share/html/Ticket/autohandler line 14.<br>
>      > > context: ...<br>
>      > > 10: |(?<!\.html))<br>
>      > > 11: $<br>
>      > > 12: }ix;<br>
>      > > 13:<br>
>      > > 14: MaybeRedirectToApproval(<br>
>      > > 15: Whitelist => $whitelist,<br>
>      > > 16: ARGSRef => \%ARGS,<br>
>      > > 17: );<br>
>      > > 18:<br>
>      > > ...<br>
>      > > code stack: /opt/rt4/share/html/Ticket/autohandler:14<br>
>      > > /opt/rt4/sbin/../local/lib/RT/Interface/Web.pm:538<br>
>      > > /opt/rt4/sbin/../local/lib/RT/Interface/Web.pm:285<br>
>      > > /opt/rt4/share/html/autohandler:53<br>
>      > ><br>
>      > > Have I done something wrong? Must I overwrite these files instead of adding to the local<br>
>      > > directory? I did move the files manually into my local copy of 4.0.5 but I thought that<br>
>      > would<br>
>      > > work.<br>
>      > > Thanks for the help. I am thinking a work around would be to just assign permissions to<br>
>      > the<br>
>      > > field. Maybe I should just wait for 4.0.6.<br>
>      > > Jim<br>
</div></div><div class="im">>      > > On Wed, Feb 29, 2012 at 6:29 AM, Ruslan Zakirov <[1][4][4]<a href="mailto:ruz@bestpractical.com">ruz@bestpractical.com</a>> wrote:<br>
>      > ><br>
>      > > Hi,<br>
>      > ><br>
>      > > You need fixes from 4.0/context-on-custom-fields branch.<br>
</div><div class="im">>      > > On Tue, Feb 28, 2012 at 20:32, Jim Lesinski <[2][5][5]<a href="mailto:jim.lesinski@gmail.com">jim.lesinski@gmail.com</a>> wrote:<br>
>      > > > I turned on debug (*new to me) and it looks like this is the relevant error<br>
>      > > > in the logs:<br>
>      > > ><br>
>      > > > Feb 28 11:22:11 buf-rtdev RT: Permission denied. User #63 has no<br>
>      > > > SeeCustomField right on CF #13<br>
>      > > ><br>
>      > > > If I assign SeeCustomField directly to the custom field (#13) for RTUser,<br>
>      > > > then the autocomplete value works.<br>
>      > > ><br>
>      > > > Maybe I am missing something here with permissions... Should I be assigning<br>
>      > > > group or specific user permissions on a field by field basis? Up until now I<br>
>      > > > had only put users in groups and assigned group permissions to queues. I do<br>
>      > > > have a couple nested groups as well, but no permissions explicitly defined<br>
>      > > > on a per field basis. It seems like it should be working though since it<br>
>      > > > does work for other field types, just not autocomplete.<br>
>      > > ><br>
>      > > ><br>
>      > > ><br>
>      > > ><br>
>      > > ><br>
</div>>      > > > On Tue, Feb 28, 2012 at 10:46 AM, Ruslan Zakirov <[3][6][6]<a href="mailto:ruz@bestpractical.com">ruz@bestpractical.com</a>><br>
<div class="im">>      > > > wrote:<br>
>      > > >><br>
>      > > >> Hi,<br>
>      > > >><br>
>      > > >> Anything in debug logs when this doesn't work?<br>
>      > > >><br>
>      > > >><br>
</div>>      > > >> On Tue, Feb 28, 2012 at 19:38, Jim Lesinski <[4][7][7]<a href="mailto:jim.lesinski@gmail.com">jim.lesinski@gmail.com</a>><br>
<div class="im">>      > > >> wrote:<br>
>      > > >> > The user (RTuser) is Privileged.<br>
>      > > >> ><br>
>      > > >> > Here is an outline of the permissions assigned to RTUser:<br>
>      > > >> ><br>
>      > > >> > RTUser is a member of a GroupA that has OwnTicket, StealTicket and<br>
>      > > >> > TakeTicket rights on the queue1.<br>
>      > > >> ><br>
>      > > >> > GroupA is a member of GroupB, which has CommentOnTicket, CreateTicket,<br>
>      > > >> > ReplyToTicket, Watch, SeeCustomField, SeeQueue, and ShowTicket<br>
>      > > >> > permissions<br>
>      > > >> > on queue1.<br>
>      > > >> ><br>
>      > > >> > To test permissions, I just now assigned every single permission to<br>
>      > > >> > RTUser<br>
>      > > >> > on the General Rights, Rights for Staff, and Rights for Administrators<br>
>      > > >> > tabs<br>
>      > > >> > to RTUser for queue1 and still the autocomplete values do not populate.<br>
>      > > >> ><br>
>      > > >> > If I go to Tools - Configuration - Global - User Rights and add RTUser<br>
>      > > >> > and<br>
>      > > >> > then check in "Do anything and everything", the autocomplete values work<br>
>      > > >> > for<br>
</div>>      > > >> > [5][8][8]<a href="http://groups.pm" target="_blank">groups.pm</a>.<br>
>      > > >> ><br>
>      > > >> ><br>
>      > > >> ><br>
>      > > >> > On Tue, Feb 28, 2012 at 10:03 AM, Thomas Sibley <[6][9][9]<a href="mailto:trs@bestpractical.com">trs@bestpractical.com</a>><br>
<div class="im">>      > > >> > wrote:<br>
>      > > >> >><br>
>      > > >> >> On 02/28/2012 09:17 AM, Ruslan Zakirov wrote:<br>
>      > > >> >> >> I have set up a custom data source for a custom field as outlined<br>
>      > > >> >> >> in external_custom_fields.pod. It seems that everything works fine<br>
>      > > >> >> >> and<br>
>      > > >> >> >> I get<br>
>      > > >> >> >> pick list data populated into the custom field for all field types<br>
>      > > >> >> >> when<br>
>      > > >> >> >> logged in as an account with root privileges. However, if I switch<br>
>      > > >> >> >> to<br>
>      > > >> >> >> an<br>
>      > > >> >> >> account that has non-root privileges, all the fields types work as<br>
>      > > >> >> >> expected<br>
>      > > >> >> >> other than the autocomplete field type. For some reason this field<br>
>      > > >> >> >> type<br>
>      > > >> >> >> returns no data when I am logged in as a non-root user account.<br>
>      > > >> >> [snip]<br>
>      > > >> >> >> Has anyone else run into this? Can someone else verify this in their<br>
>      > > >> >> >> environment?<br>
>      > > >> >> >><br>
>      > > >> >> ><br>
</div>>      > > >> >> > [7][10][10]<a href="http://issues.bestpractical.com/Ticket/Display.html?id=16946" target="_blank">http://issues.bestpractical.com/Ticket/Display.html?id=16946</a><br>
<div class="im">>      > > >> >><br>
>      > > >> >> To clarify, that bug applies to Self Service (unprivileged) users only.<br>
>      > > >> >> It's not clear if your non-root user accounts that you tested with are<br>
>      > > >> >> privileged or unprivileged. If they are privileged, autocomplete CFs<br>
>      > > >> >> should work just fine.<br>
><br>
</div>> References<br>
><br>
>    Visible links<br>
>    1. mailto:<a href="mailto:falcone@bestpractical.com">falcone@bestpractical.com</a><br>
>    2. mailto:<a href="mailto:falcone@bestpractical.com">falcone@bestpractical.com</a><br>
>    3. <a href="https://github.com/bestpractical/rt/compare/stable...4.0%2Fcontext-on-custom-fields" target="_blank">https://github.com/bestpractical/rt/compare/stable...4.0%2Fcontext-on-custom-fields</a><br>
>    4. mailto:<a href="mailto:ruz@bestpractical.com">ruz@bestpractical.com</a><br>
>    5. mailto:<a href="mailto:jim.lesinski@gmail.com">jim.lesinski@gmail.com</a><br>
>    6. mailto:<a href="mailto:ruz@bestpractical.com">ruz@bestpractical.com</a><br>
>    7. mailto:<a href="mailto:jim.lesinski@gmail.com">jim.lesinski@gmail.com</a><br>
>    8. <a href="http://groups.pm/" target="_blank">http://groups.pm/</a><br>
>    9. mailto:<a href="mailto:trs@bestpractical.com">trs@bestpractical.com</a><br>
>   10. <a href="http://issues.bestpractical.com/Ticket/Display.html?id=16946" target="_blank">http://issues.bestpractical.com/Ticket/Display.html?id=16946</a><br>
</blockquote></div><br></div></div>