This is a follow up to "Include chapters in List of Figures with titletoc?". There appears to be a problem with the original solution when a float is placed at the top of the page following a new part/chapter. In the LoF, the figure caption is then above the inserted part/chapter title (see screenshot). If we change the float position to b or anything else, it works fine.
The code below is adapted to report class, but I've checked and exists in book/report/article and its KOMA equivalents.
\documentclass{scrreprt}
\usepackage{lipsum}
\usepackage{etoolbox}
\makeatletter
\def\thisparttitle{}\def\thispartnumber{}
\newtoggle{noFigs}
\apptocmd{\@part}%
{\gdef\thisparttitle{#1}\gdef\thispartnumber{\thepart}%
\global\toggletrue{noFigs}}{}{}
\AtBeginDocument{%
\AtBeginEnvironment{figure}{%
\iftoggle{noFigs}{
\addtocontents{lof}{\protect\contentsline {part}%
{\protect\numberline {\thispartnumber} {\thisparttitle}}{}{} }
\global\togglefalse{noFigs}
}{}
}%
}
\makeatother
\begin{document}
\listoffigures
\part{Part 1}
\chapter{Hallo}
\lipsum
\section{Hallo}
\begin{figure}[t] % change placement to cbt and it works
\caption{Part 1 Fig}
Test
\end{figure}
\end{document}

Edit
The suggested solution from Heiko below has a problem when several figures/tables are in different parts. For example:
\begin{document}
\listoftables\listoffigures
\part{Part 1}
\begin{table}\caption{Part 1 Tab}\end{table}
\part{Part 2}
\begin{table}\caption{Part 1 Tab}\end{table}
\begin{figure}\caption{Part 1 Fig}\end{figure}
\end{document}





\addcontentsline{\csname ext@\@captype\endcsname} ...instead of\addtocontents{lof}...? – Jörg Nov 15 '14 at 15:23\@xfloatis called for all float objects.\@captypeexpands tofigureinside figure floats and\ext@figuretolof. In case of tables, the entry would be written tolot. – Heiko Oberdiek Nov 15 '14 at 16:13\ifcsdef {etb@tgl@no\@captype s})? Would (in principle) custom floats fromfloatpackage be supported? What would "unsupported float type" be? – Jörg Nov 15 '14 at 19:09etoolboxinternal toggle check, there is no official support for toggle existence checking (v2.1). (b) I have extended the example to show new floats via packagefloat. (c) "unsupported float type" means, there is no toggle defined for this kind of float. The example now writes a warning in this case. – Heiko Oberdiek Nov 15 '14 at 21:01