[Tex/LaTex] Biblatex: Suppressing urldate does not work (\clearfield)

biblatex

I've read through alot of entries here with a similar topic (like here or here). The solution does not work for me and I'm kind of deperate now.

That's why I'm asking this question again: How do I suppress the urldate field in biblatex.

I am using Miktex with Biber 2.2.

My MCE (adopted from here):

\documentclass{article}

\usepackage[style=authoryear-icomp]{biblatex}

\AtEveryBibitem{%
\ifentrytype{book}{
    \clearfield{url}%
    \clearfield{urldate}%
}{}
\ifentrytype{collection}{
    \clearfield{url}%
    \clearfield{urldate}%
}{}
\ifentrytype{incollection}{
    \clearfield{url}%
    \clearfield{urldate}%
}{}
}

\usepackage{filecontents}

\begin{filecontents}{test-lit.bib}
@book{Abook,
  author = {AAAAbook, A.},
  year = {2001},
  title = {Alpha},
  url = {tex.stackexchange.com},
}
@online{Bonline,
  author = {BBBBonline, B.},
  year = {2002},
  title = {Bravo},
  url = {tex.stackexchange.com},
}
@collection{Ccollection,
    editor = {CCCCColletionEditor, C.},
    year = {2002},
    title = {Charlie},
    url = {tex.stackexchange.com},
    urldate = {2010-01-01},
}
@incollection{Dincollection,
    author = {DDDDincollection, D.},
    year = {2002},
    crossref = {Ccollection},
    title = {Delta},
    url = {tex.stackexchange.com},
}
\end{filecontents}

\addbibresource{test-lit.bib}

\nocite{*}

\listfiles

\begin{document}

Abc.

\printbibliography

\end{document}

My Document looks like this:

Picture
(source: ahschulz.de)

I am also confused that the urldate is mentioned in the last entry, but there is no urldate in the bib-File.

Best Answer

According to the comments of moewe, urldate is split up into urlyear, urlmonth and urlday. Removing urlyear solves the problem.

This MCE works:

\documentclass{article}

\usepackage[style=authoryear-icomp]{biblatex}

\AtEveryBibitem{%
\ifentrytype{book}{
    \clearfield{url}%
    \clearfield{urlyear}%
}{}
\ifentrytype{collection}{
    \clearfield{url}%
    \clearfield{urlyear}%
}{}
\ifentrytype{incollection}{
    \clearfield{url}%
    \clearfield{urlyear}%
}{}
}

\usepackage{filecontents}

\begin{filecontents}{test-lit.bib}
@book{Abook,
  author = {AAAAbook, A.},
  year = {2001},
  title = {Alpha},
  url = {tex.stackexchange.com},
}
@online{Bonline,
  author = {BBBBonline, B.},
  year = {2002},
  title = {Bravo},
  url = {tex.stackexchange.com},
}
@collection{Ccollection,
    editor = {CCCCColletionEditor, C.},
    year = {2002},
    title = {Charlie},
    url = {tex.stackexchange.com},
    urldate = {2010-01-01},
}
@incollection{Dincollection,
    author = {DDDDincollection, D.},
    year = {2002},
    crossref = {Ccollection},
    title = {Delta},
    url = {tex.stackexchange.com},
}
\end{filecontents}

\addbibresource{test-lit.bib}

\nocite{*}

\listfiles

\begin{document}

Abc.

\printbibliography

\end{document}
Related Question