1. 05 Jun, 2014 3 commits
  2. 04 Jun, 2014 1 commit
    • Kevin Falcone's avatar
      Test of the Queue/ObjectId failures · 141ca2cc
      Kevin Falcone authored
      These tests are based on the RTIR initialdata file which identified the
      problem and fail on 4.2-trunk because of warnings generated during the
      initialdata load of t/api/initialdata.t
      I suspect we want to enhance our initialdata sample with any further
      Handle::InsertData hacking (or docs/initialdata.pod updates).
  3. 03 Jun, 2014 2 commits
  4. 30 May, 2014 5 commits
  5. 29 May, 2014 2 commits
  6. 28 May, 2014 6 commits
  7. 27 May, 2014 21 commits
    • Alex Vandiver's avatar
    • Alex Vandiver's avatar
    • Kevin Falcone's avatar
      Switch to ShowActions from ShowTitleBarCommands · 1aa631b9
      Kevin Falcone authored
      f0137c97 deleted ShowTitleBarCommands but commits which were merged
      later (0d8eacf3 and 775f4bd1) used them for newly refactored code,
      causing Reply/Comment/Forward to pop up all over the Approvals display,
      and generating links that either loop back to the approvals page or
      otherwise don't work.
    • Kevin Falcone's avatar
      Whitespace only change · 18526eba
      Kevin Falcone authored
      The previous commit removed an outer if block and pushed it into the
      boolean check of the elsif, leaving it weirdly indented.  This left
      shifts everything as a separate commit to make reading the previous code
      change clearer.
    • Kevin Falcone's avatar
      In 4.0, ShowTitleBarCommands didn't hide Outgoing Email links · 18957ceb
      Kevin Falcone authored
      The 4.2 equivalent ShowActions should be compatible for the places
      that want to suppress Reply/Comment/Forward.
      This makes the code change, leaves whitespace terrible.
    • Kevin Falcone's avatar
      Assuming relative paths in ShowHistory breaks Approvals history display · 324e22d3
      Kevin Falcone authored
      Show Outgoing Email goes to /Approvals/ShowEmailRecord.html which
      doesn't exist.  Additionally, Reply/Comment/Forward are broken (although
      shouldn't be visible, fixed in a later commit).
      This also shows up in RTIR where links point to
      /RTIR/ShowEmailRecord.html and /RTIR/Attachments/
      Fixes issues 29800 and lays groundwork for a fix in RTIR for 29775.
      While you could list /Ticket/Update.html and /Ticket/Crypt.html for the
      6 *Path variables passed in %ARGS, it's nicer if you can just say "use
      everything from /Ticket/, like you used to in 4.0".
      Broken when moving to relative-by-default paths in 8274e2b6.
      Since /Elements/ShowHistory isn't directly callable and the JS helper doesn't
      pass extra arguments, there are currently no ways to pass a malicious
      PathPrefix in from user supplied data.
    • Alex Vandiver's avatar
      Switch existing code to using LookupType with LoadByName, to be explicit · 487df4d9
      Alex Vandiver authored
      To set an example for future code, transition away from the 'Queue'
      argument, in preference to LookupType and ObjectId.  This helps clarify
      the type of custom field that is expected to be returned.
      Simultaneously, switch to using IncludeGlobal where the code would
      benefit from such.
    • Alex Vandiver's avatar
      Add tests for the new LoadByName functionality · f4db1cc5
      Alex Vandiver authored
      This throughly exercises the new codepath.  It leaves the existing
      t/customfields/api.t untouched, though it may be sensible to merge them
      in the future.
    • Alex Vandiver's avatar
      Document but deprecate the old names for LoadByName · 2b181e47
      Alex Vandiver authored
      While it is tempting to officially deprecate these, they are in use in
      core RT and in extensions, and introducing new deprecations during a
      stable series is unwise.  Suffice to document them as deprecated, and
      migrate exsting uses away from the, though not produce deprecation
    • Alex Vandiver's avatar
      Optimize the query slightly, by eliminating an unnecessary DISTINCT · 5ea0b2e9
      Alex Vandiver authored
      The join from CustomFields to ObjectCustomFields is guaranteed to be
      distinct, by dint of the fat that either it is global, or it matches the
      objectid we desire; as such, we can eliminate a cumbersome DISTINCT by
      informing DBIx::SearchBuilder of this property at JOIN time.
    • Alex Vandiver's avatar
      Allow callers to look in Queue and global CFs · 51d22fdd
      Alex Vandiver authored
      Previously, in order to respect global CFs, callers were forced to
      explicitly attempt to LoadByName with a queue, and then attempt again
      with Queue => 0 if it failed.
      Provide an option, defaulting to off, to first search queue CFs,
      followed by global CFs.
    • Alex Vandiver's avatar
      Allow callers to not get disabled CFs · 3165021f
      Alex Vandiver authored
      For backwards compatibility, LoadByName has always maintained the
      property that it may return a disabled custom field -- though it does so
      only if there are no matching enabled fields.
      Provide an option to control this behavior; the default is maintained as
      it was previously, for backwards compatibility.
      Note that previously, the only OrderBy was the Disabled flag -- this
      means that if there were two non-disabled custom fields with the same
      name, which one was returned was possibily non-deterministic.  This
      commit places a predictable ordering on the resolution; namely, lower
      SortOrder and lower id take precedence.
    • Alex Vandiver's avatar
      Allow for non-Queue context objects · 7d7ab570
      Alex Vandiver authored
      This opens the door for using LoadByName for custom fields not on
      Transactions, Tickets, or Queues.  Callers specify a LookupType and
      ObjectId, from which the class to load (if not RT::Queue) can be
      inferred.  Consequently, using LoadByName for User (or Asset) custom
      fields no longer requires writing an alternate and parallel
      implementation of LoadByName.
    • Alex Vandiver's avatar
      Move LookupType defaulting earlier · 25ccf89d
      Alex Vandiver authored
      We will use the LookupType as a default in the next commit, and thus
      need to have it prior to when we resolve the object (currently Queue).
    • Alex Vandiver's avatar
      Simplify logic by loading the queue even if not strictly necessary · f1c5aebc
      Alex Vandiver authored
      The existing logic in the "if" statement serves to skip the block in
      precisely one situation -- the passed Queue is numeric, and there
      already exists a ContextObject.  In such situation, it is not necessary
      to attempt to load the Queue -- but it is not harmful, either.  In fact,
      it may allow a better warning in cases where a numeric but non-existant
      Queue is passed in.  It also clarifies the logic immeasurably.
    • Alex Vandiver's avatar
      Short-circuit if a bogus Queue was passed · d68734f7
      Alex Vandiver authored
    • Alex Vandiver's avatar
    • Jim Brandt's avatar
      Tests for LoadByName with queue 0 · f6eecacf
      Jim Brandt authored
    • Jim Brandt's avatar
      Explicitly exclude 0 from queue lookup · 7473e989
      Jim Brandt authored
      A Queue value of 0 represents a global CF, but will not load a
      queue successfully. Explicitly exclude 0 from the queue load and
      context object setting. Although 57e10bf9 will now prevent this,
      it logs a warning that is inappropriate when using the documented
      API for the method.
    • Jim Brandt's avatar
      Confirm loaded queue object before setting context object · 57e10bf9
      Jim Brandt authored
      For cases where an invalid Queue value is passed as an arg,
      either a name or id of a non-existent queue or even 0, previously
      the emtpy queue object would still be set as the context object
      even though the load failed. This caused the search to add a
      Limit on a LookupType of RT::Queue, which won't find any
      custom fields.
      Check the return code to avoid setting the empty queue object and
      to warn so there is some help in the logs to track down a possible
      typo in the queue name/id.
    • Alex Vandiver's avatar
      Hide the CGI.pm "this is deprecated, install from CPAN" warnings · 2c95572f
      Alex Vandiver authored
      If other modules load CGI before we install the updated version, they
      will get the in-core version, and trigger spurious deprecation warnings.
      Quash deprecation warnings before loading to quiet this warning.