diff -u b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php --- b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php +++ b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php @@ -127,11 +127,10 @@ * @param string $filename * Filename to import. * - * @return array $keyed_content + * @return array $keyed_content, $translated_languages * All multilingual content that was read from the files. - * - * @return array $translated_languages * List of language codes that need to be imported. + * */ protected function readMultilingualContent($filename) { // Find all the language directories available for default content. @@ -177,7 +176,7 @@ } // Add keys to each content in all languages. - foreach($translated_languages as $translated_language) { + foreach ($translated_languages as $translated_language) { foreach ($data[$translated_language] as $index => $content) { $keyed_content[$translated_language][$index] = array_combine($header, $content); } @@ -253,7 +252,7 @@ * @param string $vocabulary * Machine name of vocabulary to which we should save terms. * - * @return array $values + * @return array * Data structured as a term. */ protected function processTerm(array $data, $vocabulary) { @@ -275,7 +274,7 @@ * @param array $data * Data of line that was read from the file. * - * @return array $values + * @return array * Data structured as a page node. */ protected function processPage($module_path, array $data) { @@ -310,7 +309,7 @@ * @param array $data * Data of line that was read from the file. * - * @return array $values + * @return array * Data structured as a recipe node. */ protected function processRecipe($module_path, array $data) { @@ -404,7 +403,7 @@ * @param array $data * Data of line that was read from the file. * - * @return array $values + * @return array * Data structured as an article node. */ protected function processArticle($module_path, array $data) { @@ -454,7 +453,7 @@ return $values; } - /** + /** * Process block_banner data into block_banner block structure. * * @param string $module_path @@ -462,7 +461,7 @@ * @param array $data * Data of line that was read from the file. * - * @return array $values + * @return array * Data structured as a block. */ protected function processBannerBlock($module_path, array $data) { @@ -536,7 +535,6 @@ return $values; } - /** * Process block_banner data into block_banner block structure. * @@ -545,7 +543,7 @@ * @param array $data * Data of line that was read from the file. * - * @return array $values + * @return array * Data structured as a block. */ protected function processBlock($module_path, array $data, $block_type) { @@ -627,33 +625,33 @@ */ protected function processContent($ct_machine_name, $current_content, $module_path) { switch ($ct_machine_name) { - case 'recipe': - $values = $this->processRecipe($module_path, $current_content); - break; - case 'article': - $values = $this->processArticle($module_path, $current_content); - break; - case 'page': - $values = $this->processPage($module_path, $current_content); - break; - case 'banner_block': - $values = $this->processBannerBlock($module_path, $current_content); - break; - case 'disclaimer_block': - $values = $this->processDisclaimerBlock($module_path, $current_content); - break; - case 'footer_promo_block': - $values = $this->processFooterPromoBlock($module_path, $current_content); - break; - case 'recipe_category': - case 'tags': - $values = $this->processTerm($current_content, $ct_machine_name); - break; - default: - break; - } - return $values; + case 'recipe': + $values = $this->processRecipe($module_path, $current_content); + break; + case 'article': + $values = $this->processArticle($module_path, $current_content); + break; + case 'page': + $values = $this->processPage($module_path, $current_content); + break; + case 'banner_block': + $values = $this->processBannerBlock($module_path, $current_content); + break; + case 'disclaimer_block': + $values = $this->processDisclaimerBlock($module_path, $current_content); + break; + case 'footer_promo_block': + $values = $this->processFooterPromoBlock($module_path, $current_content); + break; + case 'recipe_category': + case 'tags': + $values = $this->processTerm($current_content, $ct_machine_name); + break; + default: + break; } + return $values; + } /** * Imports content. @@ -662,7 +660,7 @@ * Entity Type to be imported * * @param string $ct_machine_name - * + * * @return $this */ protected function importContentFromFile($entity_type, $ct_machine_name) { only in patch2: unchanged: --- a/core/profiles/demo_umami/modules/demo_umami_content/tests/src/Functional/DefaultContentFilesAccessTest.php +++ b/core/profiles/demo_umami/modules/demo_umami_content/tests/src/Functional/DefaultContentFilesAccessTest.php @@ -23,7 +23,7 @@ public function testAccessDeniedToFiles() { 'images/heritage-carrots.jpg', 'languages/en/recipe_instructions/mediterranean-quiche-umami.html', 'languages/en/article_body/lets-hear-it-for-carrots.html', - 'languages/en/articles.csv', + 'languages/en/node/article.csv', ]; foreach ($files_to_test as $file) { // Hard code the path since the demo_umami profile is not installed.