Skip to content
Snippets Groups Projects
Commit 39e21798 authored by Gabor Hojtsy's avatar Gabor Hojtsy
Browse files

Issue #2940362 by Eli-T, kjay, navneet0693, markconroy, larowlan, Gábor...

Issue #2940362 by Eli-T, kjay, navneet0693, markconroy, larowlan, Gábor Hojtsy: Move recipe instruction out of csv file in to their own text file
parent 29290499
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Showing
with 87 additions and 9 deletions
# Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>
# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews
<ol>
<li>Preheat the oven to 180C and grease a 8 inch cake tin.</li>
<li>Sift the flour and cocoa powder into a bowl and add the sugar and salt.</li>
<li>Add the oil, a little at time, mixing well to avoid lumps. Add the soy milk and vanilla extract and mix thoroughly.</li>
<li>Gently pour into the cake tin and spread out until even. Bake for about 15 minutes and check with a knife (the knife should come out clean when inserted into the brownies 2cm from the edge).</li>
<li>Allow to cool in the tin for a few minutes before cooling on a wire rack.</li>
</ol>
<ol>
<li>Preheat the oven to 200C. Starting with the pastry; rub the flour and butter together in a bowl until crumbling like breadcrumbs. Add water, a little at a time, until it forms a dough.</li>
<li>Roll out the pastry on a floured board and gently spread over your tin. Place in the fridge for 20 minutes before blind baking for a further 10.</li>
<li>Whilst the pastry is cooling, gently cook the onions, garlic and courgette.</li>
<li>In a large bowl, add the soya milk, half the parmesan, and the eggs. Gently mix.</li>
<li>Once the pastry is cooked, spread the onions, garlic and sun dried tomatoes over the base and pour the eggs mix over. Sprinkle the remaining parmesan and careful lay the feta over the top. Bake for 30 minutes or until golden brown.</li>
</ol>
<ol>
<li>Preheat the oven to 220C. Mix the some of the milk and water in a jug, and add the yeast and sugar, then set aside.</li>
<li>In a bowl, mix the flour, salt and oil. Slowly add the liquid from the jug and form into a dough.</li>
<li>Break the dough in half and shape into two pizza bases. Set aside for about 15 minutes, whilst making the topping.</li>
<li>Spread the tomato puree over the pizza bases, chop the basil and rocket and sprinkle over the tomato. Lay the chopped Parma ham on top and add thick slices of mozzarella across the pizza.</li>
<li>Cook in the oven directly on the top shelf (with a tray underneath) for 10-12 minutes until the mozzarella is bubbling. Season with salt and pepper and serve.</li>
</ol>
<ol>
<li>In a large wok, brown the chicken until golden, then turn the heat down and gently cook the garlic. Add the chopped green beans and stir.</li>
<li>Add the coconut milk, green curry paste and fish sauce. Mix well and slowly simmer.</li>
<li>Add the chopped mushrooms and simmer until the chicken (or tofu) is cooked.</li>
<li>Serve with jasmine rice and a sprinkle of coriander.</li>
</ol>
<ol>
<li>In a large pan, boil the pasta in plenty of water until cooked.</li>
<li>Whilst the pasta is cooking, gently fry the onions and garlic in a little oil until soft and the onion looks clear.</li>
<li>Add the vegetarian sausages. Once browned, remove and chop into chunky bites.</li>
<li>Pop the sausages back into the pan and add the tomatoes, sugar, pesto and sun dried tomatoes. Season to taste. Simmer until most of the water from the chopped tomatoes has gone.</li>
<li>Drain the pasta and add to the pan with the sausages and tomatoes. Stir in half of the cheddar and transfer to a shallow dish. Sprinkle with the rest of the cheddar and dot the sliced mozzarella over the top.</li>
<li>Grill for 10 minutes or the cheese as melted and started to brown. Serve with basil leaves.</li>
</ol>
<ol>
<li>Preheat the oven to 180C and grease two 8 inch cake tins.</li>
<li>In a large bowl, mix the butter and sugar together, then add the eggs, flour and baking powder.</li>
<li>Spread the mix evenly between the 2 cake tins.</li>
<li>Place both tins in the middle of the preheated oven for 20 minutes, before checking with a knife. When the knife comes out clean, its ready!</li>
<li>Allow to cool in the tins before moving them onto a cooling rack.</li>
<li>Add the jam, stack, dust with icing sugar and serve with a big dollop of cream. Enjoy!</li>
</ol>
<ol>
<li>Prepare the vegetables by peeling and chopping the potatoes, finely chopping the onions, leeks and garlic.</li>
<li>Heat a little oil in a pan and add the chopped vegetables, gently cooking them for about 5 minutes.</li>
<li>Add the vegetable stock to the same pan and turn up the heat until simmering, adding the watercress after about 10 minutes. Cook until all the vegetables are soft and easily mashed.</li>
<li>Liquidize the soup either with a hand blender or in a mixer, until smooth.</li>
<li>If the soup has cooled too much whilst being liquidized, stir in the crème fraîche and reheat before serving (otherwise serve straight away). Season to taste.</li>
</ol>
title,image,alt,summary,author,recipe_category,preparation_time,cooking_time,total_time,difficulty,ingredients,recipe_instruction,number_of_servings,tags,slug
Deep mediterranean quiche,mediterranean-quiche-umami.jpg,"A delicious deep layered Mediterranean quiche, sliced.",An Italian inspired quiche with sun dried tomatoes and courgette. A perfect light meal for a summer's day.,Umami,Main course,40,30,70,medium,"For the pastry:,280g plain flour,140g butter,Cold water,For the filling:,1 onion (chopped),2 cloves of garlic (chopped),Half courgette (chopped),450ml soya milk,500g grated parmesan,2 eggs,200g sun dried tomatoes,100g feta","<ol><li>Preheat the oven to 200C. Starting with the pastry; rub the flour and butter together in a bowl until crumbling like breadcrumbs. Add water, a little at a time, until it forms a dough.</li><li>Roll out the pastry on a floured board and gently spread over your tin. Place in the fridge for 20 minutes before blind baking for a further 10.</li><li>Whilst the pastry is cooling, gently cook the onions, garlic and courgette.</li><li>In a large bowl, add the soya milk, half the parmesan, and the eggs. Gently mix.</li><li>Once the pastry is cooked, spread the onions, garlic and sun dried tomatoes over the base and pour the eggs mix over. Sprinkle the remaining parmesan and careful lay the feta over the top. Bake for 30 minutes or until golden brown.</li></ol>",8,"Pastry,Egg",recipes/deep-mediterranean-quiche
Vegan chocolate brownies,chocolate-brownie-umami.jpg,A plate with a vegan chocolate brownie covered in dark vegan chocolate,These sumptuous brownies should be gooey on the inside and crisp on the outside. A perfect indulgence!,Umami,Snack,20,20,40,,"170g self-raising flour, 3 tablespoons of cocoa powder, 170g of caster sugar, 5 tablespoons of vegetable oil, 1 teaspoon vanilla extract, A pinch of salt, 230ml soy milk","<ol><li>Preheat the oven to 180C and grease a 8 inch cake tin.</li><li>Sift the flour and cocoa powder into a bowl and add the sugar and salt. </li><li>Add the oil, a little at time, mixing well to avoid lumps. Add the soy milk and vanilla extract and mix thoroughly.</li><li>Gently pour into the cake tin and spread out until even. Bake for about 15 minutes and check with a knife (the knife should come out clean when inserted into the brownies 2cm from the edge).</li><li>Allow to cool in the tin for a few minutes before cooling on a wire rack.</li></ol>",8,,recipes/vegan-chocolate-brownies
Super easy vegetarian pasta bake,veggie-pasta-bake-umami.jpg,Cheesy pasta dish with vegetarian sausages and topped with Mozzarella,A wholesome pasta bake is the ultimate comfort food. This delicious bake is super quick to prepare and an ideal midweek meal for all the family.,Umami,Main course,5,20,25,easy,"400g wholewheat pasta, 1 chopped onion, 2 cloves of garlic, 1 pack of vegetarian sausages, 1 tin of chopped tomatoes, 50g of sliced sun dried tomatoes, Pinch of sugar, 3 tablespoons of red pesto, 50g cheddar cheese, Basil or mixed herbs, 100g mozzarella","<ol><li>In a large pan, boil the pasta in plenty of water until cooked.</li><li>Whilst the pasta is cooking, gently fry the onions and garlic in a little oil until soft and the onion looks clear.</li><li>Add the vegetarian sausages. Once browned, remove and chop into chunky bites.</li><li>Pop the sausages back into the pan and add the tomatoes, sugar, pesto and sun dried tomatoes. Season to taste. Simmer until most of the water from the chopped tomatoes has gone.</li><li>Drain the pasta and add to the pan with the sausages and tomatoes. Stir in half of the cheddar and transfer to a shallow dish. Sprinkle with the rest of the cheddar and dot the sliced mozzarella over the top.</li><li>Grill for 10 minutes or the cheese as melted and started to brown. Serve with basil leaves.</li></ol>",4,"Vegetarian,Pasta,Baked",recipes/super-easy-vegetarian-pasta-bake
Watercress soup,watercress-soup-umami.jpg,Light and simply presented watercress soup with a sprig of coriander to finish,"A wonderfully simple and light soup, making the most of seasonal, local produce. ",Umami,Starter,10,20,30,easy,"3 bunches of watercress,3 potatoes,3 onions,2 leeks,800ml stock,5 tablespoons of crème fraîche","<ol><li>Prepare the vegetables by peeling and chopping the potatoes, finely chopping the onions, leeks and garlic.</li><li>Heat a little oil in a pan and add the chopped vegetables, gently cooking them for about 5 minutes.</li><li>Add the vegetable stock to the same pan and turn up the heat until simmering, adding the watercress after about 10 minutes. Cook until all the vegetables are soft and easily mashed.</li><li>Liquidize the soup either with a hand blender or in a mixer, until smooth.</li><li>If the soup has cooled too much whilst being liquidized, stir in the crème fraîche and reheat before serving (otherwise serve straight away). Season to taste.</li></ol>",4,"Soup,Vegetarian",recipes/watercress-soup
Victoria sponge cake,victoria-sponge-umami.jpg,"A classic, uncut Victoria sponge with a deep filling of butter cream and jam","A traditional Victoria sponge cake, perfect for any afternoon with a cup of tea.",Umami,Desert,20,20,40,easy,"225g butter or margarine,225g caster sugar,225g self-raising flour,4 eggs,1 level teaspoon of baking powder,3 tablespoons of jam for the filling,Icing sugar to dust the top,Cream to serve","<ol><li>Preheat the oven to 180C and grease two 8 inch cake tins.</li><li>In a large bowl, mix the butter and sugar together, then add the eggs, flour and baking powder.</li><li>Spread the mix evenly between the 2 cake tins.</li><li>Place both tins in the middle of the preheated oven for 20 minutes, before checking with a knife. When the knife comes out clean, its ready!</li><li>Allow to cool in the tins before moving them onto a cooling rack.</li><li>Add the jam, stack, dust with icing sugar and serve with a big dollop of cream. Enjoy!</li></ol>",10,Cake,recipes/victoria-sponge-cake
Gluten free pizza,pizza-umami.jpg,"Olives, basil and mozzarella top a gluten free pizza base","A gorgeous and simple gluten free pizza, with deliciously indulgent mozzeralla and Parma ham. Can easily be vegetarian by leaving out the ham.",Umami,Main course,15,15,30,,"400g gluten free flour, 125ml warm water, 125ml milk, 1 sachet of dried yeast, 2 teaspoons of sugar, 1 teaspoons of salt, 2 tablespoons olive oil, 4 tablespoons of tomato puree, 1 clove of garlic, Some fresh basil, 200g of mozzarella, 100g rocket, 5 slices of Parma ham","<ol><li>Preheat the oven to 220C. Mix the some of the milk and water in a jug, and add the yeast and sugar, then set aside.</li><li>In a bowl, mix the flour, salt and oil. Slowly add the liquid from the jug and form into a dough. </li><li>Break the dough in half and shape into two pizza bases. Set aside for about 15 minutes, whilst making the topping.</li><li>Spread the tomato puree over the pizza bases, chop the basil and rocket and sprinkle over the tomato. Lay the chopped Parma ham on top and add thick slices of mozzarella across the pizza.</li><li>Cook in the oven directly on the top shelf (with a tray underneath) for 10-12 minutes until the mozzarella is bubbling. Season with salt and pepper and serve.</li></ol>",4,,recipes/gluten-free-pizza
Thai green curry,thai-green-curry-umami.jpg,"A traditional bowl of creamy, aromatic Thai green curry with chunks of chicken and a small bowl of jasmine rice.",A quick and easy version of the classic Thai green curry. Perfect for a midweek meal!,Umami,Main course,10,15,25,,"400g coconut milk, 400g chicken or tofu, 1 tablespoon of Thai green curry paste, 1 clove of garlic, 2 teaspoons of fish sauce, 400g mushrooms, 200g green beans, Fresh coriander leaves, Jasmine rice","<ol><li>In a large wok, brown the chicken until golden, then turn the heat down and gently cook the garlic. Add the chopped green beans and stir.</li><li>Add the coconut milk, green curry paste and fish sauce. Mix well and slowly simmer.</li><li>Add the chopped mushrooms and simmer until the chicken (or tofu) is cooked.</li><li>Serve with jasmine rice and a sprinkle of coriander.</li></ol>",4,,recipes/thai-green-curry
\ No newline at end of file
title,image,alt,summary,author,recipe_category,preparation_time,cooking_time,total_time,difficulty,ingredients,recipe_instruction,number_of_servings,tags,slug
Deep mediterranean quiche,mediterranean-quiche-umami.jpg,"A delicious deep layered Mediterranean quiche, sliced.",An Italian inspired quiche with sun dried tomatoes and courgette. A perfect light meal for a summer's day.,Umami,Main course,40,30,70,medium,"For the pastry:,280g plain flour,140g butter,Cold water,For the filling:,1 onion (chopped),2 cloves of garlic (chopped),Half courgette (chopped),450ml soya milk,500g grated parmesan,2 eggs,200g sun dried tomatoes,100g feta",mediterranean-quiche-umami.html,8,"Pastry,Egg",recipes/deep-mediterranean-quiche
Vegan chocolate brownies,chocolate-brownie-umami.jpg,A plate with a vegan chocolate brownie covered in dark vegan chocolate,These sumptuous brownies should be gooey on the inside and crisp on the outside. A perfect indulgence!,Umami,Snack,20,20,40,,"170g self-raising flour, 3 tablespoons of cocoa powder, 170g of caster sugar, 5 tablespoons of vegetable oil, 1 teaspoon vanilla extract, A pinch of salt, 230ml soy milk",chocolate-brownie-umami.html,8,,recipes/vegan-chocolate-brownies
Super easy vegetarian pasta bake,veggie-pasta-bake-umami.jpg,Cheesy pasta dish with vegetarian sausages and topped with Mozzarella,A wholesome pasta bake is the ultimate comfort food. This delicious bake is super quick to prepare and an ideal midweek meal for all the family.,Umami,Main course,5,20,25,easy,"400g wholewheat pasta, 1 chopped onion, 2 cloves of garlic, 1 pack of vegetarian sausages, 1 tin of chopped tomatoes, 50g of sliced sun dried tomatoes, Pinch of sugar, 3 tablespoons of red pesto, 50g cheddar cheese, Basil or mixed herbs, 100g mozzarella",veggie-pasta-bake-umami.html,4,"Vegetarian,Pasta,Baked",recipes/super-easy-vegetarian-pasta-bake
Watercress soup,watercress-soup-umami.jpg,Light and simply presented watercress soup with a sprig of coriander to finish,"A wonderfully simple and light soup, making the most of seasonal, local produce. ",Umami,Starter,10,20,30,easy,"3 bunches of watercress,3 potatoes,3 onions,2 leeks,800ml stock,5 tablespoons of crème fraîche",watercress-soup-umami.html,4,"Soup,Vegetarian",recipes/watercress-soup
Victoria sponge cake,victoria-sponge-umami.jpg,"A classic, uncut Victoria sponge with a deep filling of butter cream and jam","A traditional Victoria sponge cake, perfect for any afternoon with a cup of tea.",Umami,Desert,20,20,40,easy,"225g butter or margarine,225g caster sugar,225g self-raising flour,4 eggs,1 level teaspoon of baking powder,3 tablespoons of jam for the filling,Icing sugar to dust the top,Cream to serve",victoria-sponge-umami.html,10,Cake,recipes/victoria-sponge-cake
Gluten free pizza,pizza-umami.jpg,"Olives, basil and mozzarella top a gluten free pizza base","A gorgeous and simple gluten free pizza, with deliciously indulgent mozzeralla and Parma ham. Can easily be vegetarian by leaving out the ham.",Umami,Main course,15,15,30,,"400g gluten free flour, 125ml warm water, 125ml milk, 1 sachet of dried yeast, 2 teaspoons of sugar, 1 teaspoons of salt, 2 tablespoons olive oil, 4 tablespoons of tomato puree, 1 clove of garlic, Some fresh basil, 200g of mozzarella, 100g rocket, 5 slices of Parma ham",pizza-umami.html,4,,recipes/gluten-free-pizza
Thai green curry,thai-green-curry-umami.jpg,"A traditional bowl of creamy, aromatic Thai green curry with chunks of chicken and a small bowl of jasmine rice.",A quick and easy version of the classic Thai green curry. Perfect for a midweek meal!,Umami,Main course,10,15,25,,"400g coconut milk, 400g chicken or tofu, 1 tablespoon of Thai green curry paste, 1 clove of garlic, 2 teaspoons of fish sauce, 400g mushrooms, 200g green beans, Fresh coriander leaves, Jasmine rice",thai-green-curry-umami.html,4,,recipes/thai-green-curry
......@@ -219,7 +219,11 @@ protected function importRecipes() {
}
// Set field_recipe_instruction Field.
if (!empty($data['recipe_instruction'])) {
$values['field_recipe_instruction'] = [['value' => $data['recipe_instruction'], 'format' => 'basic_html']];
$recipe_instruction_path = $module_path . '/default_content/recipe_instructions/' . $data['recipe_instruction'];
$recipe_instructions = file_get_contents($recipe_instruction_path);
if ($recipe_instructions !== FALSE) {
$values['field_recipe_instruction'] = [['value' => $recipe_instructions, 'format' => 'basic_html']];
}
}
// Set field_tags if exists.
if (!empty($data['tags'])) {
......
......@@ -89,6 +89,8 @@ protected function assertRecipesImported(EntityStorageInterface $node_storage) {
$this->assertGreaterThan(0, $count);
$nodes = $node_storage->loadByProperties(['title' => 'Gluten free pizza']);
$this->assertCount(1, $nodes);
$node = reset($nodes);
$this->assertContains('Mix the some of the milk and water in a jug', $node->field_recipe_instruction->value);
}
/**
......
......@@ -174,4 +174,15 @@ public function testAccessDeniedToSampleImages() {
$this->assertSession()->statusCodeEquals(403);
}
/**
* Tests that sample recipes are not accessible to the webserver.
*/
public function testAccessDeniedToSampleRecipes() {
$file_name = 'chocolate-brownie-umami.html';
$file_path = '/' . drupal_get_path('module', 'demo_umami_content') . '/default_content/recipe_instructions/' . $file_name;
$this->assertTrue(file_exists(DRUPAL_ROOT . $file_path));
$this->drupalGet($file_path);
$this->assertSession()->statusCodeEquals(403);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment