joomla/joomla-cms — pull request #3558 by level420 (2014-05-05 11:05:23+00:00)
Title: Fix for "duplicate key on insert detected" errors  in FinderIndexerHelper::addContentType

When indexing content via a finder plugin which may have multiple mime types (e.g. document management systems, pdf, doc, zip etc.), adding a new mime type will work, but if another document with this mime type exists, consecutive getting the type id results in a duplicate insert in table #__finder_types.
This is due to that the static method variable $types is initialized on the first call of the method and does not take in account mime types inserted after initialization.

The fix adds the newly inserted mime type in the $types hash, so that calling this method againg with the same mimetype results in a positive lookup within the hash.