-
mdb_idscopes was remembering the IDs of every entry it checked; it should only have been saving the IDs of entries that were actually in the search scope. The extra entries filled the scopes array, causing a loop searching for a parent entry that was never inserted.
cb7405ae