From: Harris Wong Date: Wed, 5 Oct 2011 19:58:06 +0000 (-0000) Subject: 4873: Added a condition in to handle OpenLearn packages. X-Git-Tag: v1.2~5 X-Git-Url: https://iam.tj/gitweb/gitweb.cgi?p=acontent.git;a=commitdiff_plain;h=9dde0528e944a0107949a63fdf849701f2212054 4873: Added a condition in to handle OpenLearn packages. If "Share" is part of the common path calculation, then skip it. Reason is the "Shared" directory is relative to content directory. We should use content directory as the common path. --- diff --git a/docs/home/ims/ims_import.php b/docs/home/ims/ims_import.php index 2cb8fc0..6637569 100644 --- a/docs/home/ims/ims_import.php +++ b/docs/home/ims/ims_import.php @@ -538,9 +538,11 @@ function removeCommonPath($items){ //find the intersection of each item's related files, then that intersection is the content_path if (isset($items[$current_identifier]['file'])){ foreach ($items[$current_identifier]['file'] as $resource_path){ - $temp_path = pathinfo($resource_path); - $temp_path = explode('/', $temp_path['dirname']); - $package_base_path = array_intersect_assoc($package_base_path, $temp_path); + if (!strpos($resource_path, 'Share')) { + $temp_path = pathinfo($resource_path); + $temp_path = explode('/', $temp_path['dirname']); + $package_base_path = array_intersect_assoc($package_base_path, $temp_path); + } } } }