I'm modifying an older university template that requires all table captions to be set in uppercase in the text, but does not require this in the list of tables. To automate the process, I've patched the corresponding parts of the template to use \MakeTextUppercase in the caption macros. This works until the option final is passed to the underlying book class, and hyperref clashes with with \MakeTextUppercase. Here's a MWE:
\documentclass[final]{book}
\usepackage{hyperref}
\usepackage{textcase}
\makeatletter
\renewenvironment{table}{%
\let\@makecaption\@maketablecaption
\@float{table}}{\end@float}
\long\def\@maketablecaption#1#2{
\begin{center}
\makebox[\linewidth]{
\parbox{\linewidth}{
\centering
\MakeTextUppercase{#1}\\
\MakeTextUppercase{#2}%\par
}%
}%
\end{center}
}
\makeatother
\begin{document}
\listoftables
\chapter{One}
\begin{table}
\caption{A Caption}
\end{table}
\end{document}
And here is the resulting error message that disappears if \MakeTextuppercase is removed:
! Undefined control sequence.
\@hyper@@anchor ...r@spot {#2#3}\let \put@me@back
\@empty \ifx \relax #2\rel...
l.30 \caption{A Caption}
I don't want to list of tables to have an uppercase table caption, the caption should only be in upper case in the running text. Is there a simple modification of the above example that allows for that? How do I apply \MakeTextUppercase to the text caption part only and not the caption part in the list of tables? I don't want to include additional packages, since this is all part of a larger template…

\caption[A Caption]{A CAPTION}. You could embody it as\newcommand\mycaption[1]{\caption[#1]{\uppercase{#1}}}– Steven B. Segletes Jun 19 '17 at 13:08\captiononly for the table environment. – matz-e Jun 19 '17 at 13:10\let\svcaption\caption \renewcommand\caption[1]{\svcaption[#1]{\uppercase{#1}}}– Steven B. Segletes Jun 19 '17 at 13:11\MakeTextUppercase{#1}\\\MakeTextUppercase{#2}to#1\\#2. – Steven B. Segletes Jun 19 '17 at 13:29\let\scaption\caption\renewcommand*{\caption}[2][\shortcaption]{\def\shortcaption{##2}\scaption[\shortcaption]{\MakeTextUppercase{##2}}}%in the table redefinition, after this comment, and it will leave figure captions unchanged. – matz-e Jun 19 '17 at 13:35caption? Maybe? – cfr Jul 02 '17 at 03:08