# troubles with moderncv after Miktex update

I have been using moderncv to generate some cover letters and CVs recently. Everything was working fine, until I have done a Miktex update. I keep getting the error Undefined control sequence. \makelettertitle for the following MWE (Which used to worjk without any problems!):

\documentclass[12pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage{lipsum}

\usepackage[scale=0.82]{geometry} \geometry{textheight=25cm}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
\usepackage{ragged2e}
\usepackage{pdfpages}
%%%%%%%%%%%%%%%%%%%

\makeatletter

\renewcommand*{\makelettertitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputeletterlengths%
% sender contact info
%\hfill%
\begin{minipage}{.5\textwidth}%
\raggedright% \raggedleft
\makebox[\textwidth][l]{\makebox[2\textwidth]{\bfseries\upshape\@firstname~\@lastname\hfill\normalfont\textcolor{black}{\@date}}}\@firstdetailselementfalse%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}%
\end{minipage}\\[3em]
% recipient block
\begin{minipage}[t]{.5\textwidth}
\raggedright%
{\@recipientname}\\%
\end{minipage} \\[2em]
% date
%\hfill% US style
%  \\[1em]% UK style
%\@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900"
% opening
\raggedright%
\@opening\\[1.5em]%
% ensure no extra spacing after \makelettertitle due to a possible blank line
%  \ignorespacesafterend% not working
\hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}}

\setlength{\makecvtitlenamewidth}{12cm}
\renewcommand*{\namefont}{\fontsize{24}{29}\mdseries\upshape}

\makeatother

%\patchcmd{\makeletterclosing}{[2em]}{[1em]}{}{}
\familyname{XXXXXX}
\title{CV}
\email{XXXXXXXXXXXXXX@XXXX.XXX}
\begin{document}
\recipient{XXXX}{XXXX\\XXXXXXXXXXXX\\1234 XXXXXX\\XXXXXX}
\date{\today} % Letter date
\opening{blablabla,} % Opening greeting
\closing{blablabla} % Closing phrase
\enclosure[Im Anhang]{CV} % List of enclosed documents

\makelettertitle % Print letter title
\blindtext[3]
\makeletterclosing % Print letter signature
\clearpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Lebenslauf
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\clearpage

\makecvtitle % Print the CV title

\section{EDV- Kenntnisse}

\cvitem{Tool}{C, C++, VHDL}
\cvitem{Betriebssystem}{Unix, Windows}
\cvitem{Simulations-Tools}{Tool, Tool, Tool II, Tool}

%---------------------------------

\end{document}


Any help is appreciated.

Update: Following the log file, the errors are the following:

• Undefined control sequence. \setlength{\makecvtitlenamewidth}{12cm}
• Missing number, treated as zero. \renewcommand
• Illegal unit of measure (pt inserted). \renewcommand

Which are respectively originating from the two commands:

 \setlength{\makecvtitlenamewidth}{12cm}
\renewcommand*{\namefont}{\fontsize{24}{29}\mdseries\upshape}

• Check if you have a local copy of moderncv or some of its components in your working folder. – Werner Aug 30 '15 at 20:29
• @Werner. I just removed all local copies, but Still the problem is persisting – user2536125 Aug 30 '15 at 20:44
• @Sigur, I just found out the problem is coming from the line '\setlength{\makecvtitlenamewidth}{12cm}' but i still can't solve it – user2536125 Aug 30 '15 at 20:45
• The length is not defined. \newlength{\makecvtitlenamewidth} – Johannes_B Aug 31 '15 at 5:53

\makecvtitlenamewidth existed as part of moderncv 1.5.0, but was removed from moderncv 1.5.1 - the current latest version.
The current replacement seems to be \makecvheadnamewidth, which a default of 0pt (used in conditioning for an automatically set width).