The standard critical view is represented as follows:-

‘The modern study of the book has taken its point of departure in the correspondence between the religious reforms of Josiah (640-609 BC) and the cultic legislation of Deuteronomy, especially the disestablishment of the provincial sanctuaries (called ‘high places’ in the Old Testament) and the proscription of pagan cult practices.  According to the narrator, these reforms were precipitated by the finding of a law book during repair work on the temple during the eighteenth year of the king’s reign (2 Kings 22:8).  It may be surmised, however, that the very fact of repairing the temple pointed to a movement of religious renewal already underway, a surmisal which is confirmed by the author of Chronicles who dates the beginning of the reform six years earlier than the finding of the book (2 Chron 34:3-7).  The book in question was certainly Deuteronomy, or so the author wished it to be understood.  But whether the account of its discovery is historical and, if so, whether had really be lost, or, rather ‘planted’ by the reform party for their own purposes and with the best of intentions, are questions which can no longer be answered with certainty.’

(Blenkisopp, Wisdom and Law in the Old Testament, 96).