private function fixupPresentationRoleHypercubes( $roleKey )
	{
		// $this->log()->info( "$role" );
		if ( ! isset( $this->context->presentationRoleRefs[ $roleKey ] ) ) return;
		if ( ! isset( $this->context->presentationRoleRefs[ $roleKey ]['href'] ) ) return;

		// BMS 2016-02-15
		/**
		 * @var XBRL $home_taxonomy
		 */
		$home_taxonomy = $this->getTaxonomyForXSD( $this->context->presentationRoleRefs[ $roleKey ]['href'] );
		// $home_taxonomy = $this;

		if ( ! isset( $this->context->presentationRoleRefs[ $roleKey ]['hierarchy'] ) ) return;

		$home_taxonomy->ResetAllItemCaches();

		$roleHypercubes = $home_taxonomy->assignNodeHypercubes( $this->context->presentationRoleRefs[ $roleKey ]['hierarchy'], $this->context->presentationRoleRefs[ $roleKey ]['locators'], $roleKey );
		$this->context->presentationRoleRefs[ $roleKey ]['hypercubes'] = $roleHypercubes;

		$this->pruneNodeHypercubes( $this->context->presentationRoleRefs[ $roleKey ]['hierarchy'] );

		$before = count( $this->context->presentationRoleRefs[ $roleKey ]['paths'] );
		// Although a 'paths' index has been built it needs to be re-built
		// because the 'pruneNodeHypercubes' function is likely to have removed
		// some nodes meaning the existing index will contain invalid entries
		$this->context->presentationRoleRefs[ $roleKey ]['paths'] = $home_taxonomy->createHierarchyPaths( $this->context->presentationRoleRefs[ $roleKey ]['hierarchy'] );
		$after = count( $this->context->presentationRoleRefs[ $roleKey ]['paths'] );
		if ( $before != $after )
		{
			// $x = 1;
		}
	}