# Sectioning created via titlesec have wrong \label

I have created the following custom sectioning using the titlesec package.

% in the preamble

\newcounter{phase}
\titleclass{\phase}{straight}[\section]
\titleformat{\phase}{\bfseries\sffamily}{Phase~\thephase:}{1mm}{}
\renewcommand{\thephase}{\arabic{phase}}

% within the document

\phase{Target selection and testbed preparation} % outputs Phase 1: Target selection and testbed preparation
\label{sec:phase-selection}

...

\task{Identification of target systems} % outputs Task 1.1: Identification of target systems

% later on in the document (ISSUE!)



Why doesn't the label contain the correct counter?

-

\renewcommand{\thetask}{\thephase.\arabic{task}}

... of course, the titleformat for task will also have to be changed to reflect that. –  Willie Wong Oct 12 '10 at 23:18