Add a new case to deal with an object item in addWarning

Allows to add some information as item when an object is used in addWarning (case encountered in the PIM product writer).
@BitOne @antoineguigan do you know why we use the previous trick on $element ?