Page Break Module Not Added In Between Pages

When creating a Unit with multiple pages, the "page_break_module" is not being added in between the different pages. This results in everything being seen as a Single Page, and thus breaks some layouts and functionality.

In our theme we are making a call to

$unit_class	 = new Unit( $unit->ID );
$unit_pages	 = $unit_class->get_number_of_unit_pages();

However, the $unit_pages is being returned as a 1. This is for all new courses and pages. This was working as expected before, and only recently starting creeping up.

In further troubleshooting, we took this function out of the "class.course.unit.php" and implemented it directly into our theme and printed out the $class_names. This is how we were able to determine that for our new pages the "page_break_module" was not being inserted.

function get_number_of_unit_pages( $unit_id = '' ) {
			if ( $unit_id == '' ) {
				    $unit_id = $this->id;

			$module	 = new Unit_Module();
			$modules = $module->get_modules( $unit_id );

			$pages_num = 1;

			foreach ( $modules as $mod ) {
				    $class_name = $mod->module_type;
            echo $class_name.'<br/>';
				    if ( class_exists( $class_name ) ) {
					        $module = new $class_name();

					        if ( $module->name == 'page_break_module' ) {

			return $pages_num;

You'll notice that this code is dependent on the 'page_break_module' as well and since the "page_break_module" is not there, it is saying the number of unit pages is 1, rather than the real amount.

Please let me know if any further clarification is needed.