I got a brilliant solution to a question on how to manipulate the subsection to also be given by letters:
Numbering subsections, manually set letters or numbers
But, unfortunately I got an issue with the table of contents
\documentclass{article}
\usepackage{hyperref}
%\usepackage{letltxmacro}
\NewCommandCopy{\originalsubsection}{\subsection} %\LetLtxMacro{\originalsubsection}{\subsection} \RenewDocumentCommand{\subsection}{sd()O{#3}m}{% \IfBooleanTF{#1}
{\originalsubsection*{#4}}%
{%
\IfNoValueTF{#2}
{% no letter
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}%
}
{% letter
\addtocounter{subsection}{-1}%
\renewcommand{\thesubsection}{\thesection.#2}%
}
\originalsubsection[#3]{#4}%
}% }
\renewcommand{\theHsubsection}{\thesubsection}
\begin{document}
\tableofcontents
\section{First section}
\subsection(P){First subsection}
\subsubsection{First subsubsection}
\subsubsection{Second subsubsection}
\subsection(V){Second subsection}\label{v}
\subsubsection{First subsubsection}\label{1-v}
\section{First section}
\subsection{First subsection}
\ref{v} and \ref{1-v}
\end{document}
The table of content looks like this:
Where NoValue is shown in the subsections with letters.
Any idea how to fix this? Thank you!

