MDL-40404 Libraries: Deprecated get_parent_contextid()
MDL-40404 Libraries: Moved DEVELOPER_DEBUG outside loop