Curious interaction between KOMA, fontenc and hyperref when using hidden glossary entries

In this question is asked how to hide single entries from my acronyms list. The solution works fine in the minimal example from that question. However, trying to use that solution in my actual document, I get another strange problem. My new minimal example:

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage[acronym,shortcuts,acronymlists={hidden}]{glossaries}

\newglossary[algh]{hidden}{acrh}{acnh}{Hidden Acronyms}
\makeglossaries

\newacronym{ex1}{Example 1}{should be displayed in list of acronyms when used at least once}
\newacronym[type=hidden]{ex2}{Example 2}{should never be displayed in list of acronyms}

\begin{document}
\printglossary[type=\acronymtype]
I use \textbf{\acs{ex1}} and \textbf{\acs{ex2}}  in my text.
\end{document}


This results in a pdftex warning about a non-existing reference, name:{glo:ex2}, which gets replaced by a fixed one. I'd say, this comes from the hyperref-package. But the warning only appears, when I use KOMA-documentclass scrartcl AND the T1 option of fontenc-package. When using plain article or just fontenc without options, everything is fine. Any clues?

-
This does not compile for me. Produces Argument of \@fileswith@ptions has an extra }. Also, I think I read something about hyperref should be last package loaded? –  Peter Grill Oct 17 '11 at 15:40
Once I fix the typo with the misplaced } near }]glossaries}, this seems to compile fine for me. –  Peter Grill Oct 17 '11 at 15:44
You're right, I lost a bracket while editing. Generally you're right about loading hyperrref last, but there are a few exceptions to that rule: See here –  meep.meep Oct 17 '11 at 15:48
@Peter Grill: But I think you already found the solution, at least for this mwe. When I change the order of hyperref and glossaries, the warning disappears. Now I only have to check, whether this produces other undesired behaviour. –  meep.meep Oct 17 '11 at 15:52

I can't really believe that you get the warning only with scrartcl and/or T1-encoding. I get it also with article (and it is certainly related to hyperref). You can avoid it by disabling the link in the acronym:

\acs[hyper=false]{ex2}

-
That's funny. I just checked again and I definitely get no warning when simply using article instead of scrartcl. –  meep.meep Oct 17 '11 at 16:05
But either way, your solution works just fine. Thanks. –  meep.meep Oct 17 '11 at 16:24

Loading the hyperref package after glossaries eliminates the warning in this case.

Generally, hyperref should be loaded last, but there are several exceptions as pointed out in Which packages should be loaded after hyperref instead of before?. While gloassaies is listed as one of the exceptions, the following comment should be noted:

...although glossaries can be loaded before hyperref, you have to jump through extra hoops to make it work quite as well...

-
Thanks for your answer. The problem is, when loading hyperref after glossaries all hyperlinks disappear. So for me it's clearly better to load hyperref first. Even if there is a way to get the desired hyperlinks back, this would probably get way to complicated. But thanks anyway. :) –  meep.meep Oct 17 '11 at 16:35