failing tests for "Queue != 'Missing'" searches
use 0 instead of NULL in object based _EnumLimit

->Id call returns undef for not existing object and resulting
SQL can be 'main.column = NULL' or 'main.column != NULL'. Both
variants return empty set (at least on mysql) what is wrong
for negative condition.

The most user visible example: 'Queue != "Queue That Does Not Exist"'
fix user autocomplete for oracle because it treats empty string as NULL

see also #20873
Remove even deleted Personal groups

These escaped the 3.9.2 upgrade step because RT::Groups assumes Disabled
= 0 on searches unless explicitly told otherwise.
Refer people to UPGRADING-4.0, not to the old UPGRADING file
Force IE to use the latest renderer available and disable compat mode

This was noted recently in [rt3 #21534], and RT really should have been
including it for a while now.

Compatibility mode can lead to bugs and lockups under some conditions
(see the CSS3Pie fiasco) and using an older IE rendering engine is never
better.
Default to the previously selected user/group in the rights editor

Prevents confusion across form submission by keeping the rights editor
looking at the same principal panel.  Resolves [rt3 #19205].

This works even for newly added principals, which need translation from
a submitted Name to a principal ID.  Part of this translation/lookup
logic is refactored out of ProcessACLs() so that both the backend and UI
piece can use the same code (_ParseACLNewPrincipal).

Anchor generation is changed to omit the grouping name to cleanly
separate this code from the principal map generated by
GetPrincipalsMap(), rather than adding assumptions.

Based on an initial implementation by sunnavy.
Stay on the same rights subtab when switching between principals

By hooking the "show" event instead of the "select" event we avoid an
infinite loop when we then select the new tab in each tabset: by the
time "show" fires, the selected tab is already correct.

Based on an initial implementation by sunnavy, which differed primarily
in hooking the "select" event and unregistering/re-registering to work
around the loop.

Resolves [rt3 #19769].
Preserve the selected rights category tab across page reloads

For example: granting a right to "Privileged" from the "Rights for
Administrators" tab will return you to both tabs after submission.

We still need the anchor framework for the principal tabs in order to
translate newly added principals to their correct tab server-side.  The
non-newly-added-principal side could be replaced with similar cookie
usage, but it seems not as worthwhile since we'll still be stuck
wrangling anchors.  One slightly verbose method is better than two
competing methods.
Devel::StackTrace 1.28/1.29 doesn't work with RT

because it has a serious bug, from 1.30 Changelog:

- There was an eval which did not first localize $@ and $SIG{__DIE__}. This
  broke Plack::Middleware::StackTrace (and possibly other tihngs)..

see also #21648
Restore the link to Queues/History.html

This appears to have been dropped during the creation of Elements/Tabs
Add docs on ways to style and theme RT
show mobile login on mobile clients

also, if user access urls starting with /m/, even though it's not a mobile
client, we also show the mobile login.
mimic the login error message for mobile login
basic login test
Don't let the NotMobile query param trigger CSRF

Otherwise clicking the "Not a mobile browser?" link can trigger CSRF
warnings.
Preserve page anchors on the mobile login as well

Ported from 9a57c79, without the use of jQuery.  Requires always
submitting to /NoAuth/Login.html instead of the old dynamic form action
logic.  That's OK because Login.html now renders the mobile login page
if necessary.  The dynamic form action logic was previously removed from
the main /Elements/Login during the original login reworking.
Inform the user logging in about potential side-effects on mobile login too

Ported from 5d56935.
Ensure that leading newlines in templates are preserved on submit

2d96251 removed a newline after the opening <textarea> -- however, browsers
assume that the first newline in a <textarea> is for formatting, and do not
include it in their submitted value.  This lead to the first newline
 of templates being removed on submit.  See [issues #21152].

The part of the spec that says this is how browsers should behave is
http://www.w3.org/TR/html4/appendix/notes.html#h-B.3.1

The failing tests included with this commit are TODOed. Current versions of
WWW::Mechanize do not act as browsers do in this regard.
Merge branch '4.0/preserve-leading-template-newlines' into 4.0-trunk