Skip to content
  • Kevin Falcone's avatar
    Check the id from the table and by loading the Object. · cc956231
    Kevin Falcone authored
    An optimization was added in a64a16d1 so that if you were trying to
    find the "Custom Field Object" from a Ticket, it would shortcut and
    return $ticket->Queue rather than loading $ticket->QueueObj->Id.
    
    Unfortunately, $ticket->Queue is protected by ShowTicket while
    $ticket->QueueObj->Id is protected by SeeQueue.  It's not uncommon in RT
    for a user to be granted SeeQueue and CreateTicket but not be given
    ShowTicket (a dropbox queue where you create tickets but then don't see
    them anymore).
    
    In this setup on 4.0.9, any custom field values entered on
    Ticket/Create.html will be silently discarded because $ticket->Queue
    returns undef. This results in the Custom Field not being found and
    AddCustomFieldValue not saving it.
    
    This was revealed in the RTIR test suite which tests just such a
    scenario using Constituencies (you can submit a ticket that you then
    can't see because it belongs to a separate Constituency).
    cc956231