Sometimes $parent->parentNode is null and fails.

Please merge with the main 3.1 source.

protected function moveMarkerToCompliantHome($node, $parent, $location) {
		// Move before block parent
		if($location == self::BEFORE) {
            if (isset($parent->parentNode))
			    $parent->parentNode->insertBefore($node, $parent);
		}

Thanks

Regards,
Jose A.