Bug #89398

YAML import missing support for environment variables placeholders

Added by Stig Nørgaard Færch almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2019-10-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The docs describe (https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/SiteHandling/UsingEnvVars.html) the possibility of using environment variables placeholders in YAML configuration files.
It works fine expect on imports definitions, as it is processed before the placeholders. On simple addition, would fix this though.

The use case for us, is that we set a custom environment variable CONFIG_KEY which will load a specific YAML file, depending on the value.

Index: staging3s/public/typo3/sysext/core/Classes/Configuration/Loader/YamlFileLoader.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- staging/public/typo3/sysext/core/Classes/Configuration/Loader/YamlFileLoader.php    (date 1570787062004)
+++ staging/public/typo3/sysext/core/Classes/Configuration/Loader/YamlFileLoader.php    (date 1570787062004)
@@ -112,6 +112,7 @@
     {
         if (isset($content['imports']) && is_array($content['imports'])) {
             foreach ($content['imports'] as $import) {
+                $import  = $this->processPlaceholders($import, $import);
                 $importedContent = $this->load($import['resource']);
                 // override the imported content with the one from the current file
                 $content = $this->merge($importedContent, $content);


Related issues

Has duplicate TYPO3 Core - Feature #89410: Placeholders for YAML import statementClosed2019-10-14

Actions
#1

Updated by Stig Nørgaard Færch almost 2 years ago

  • Description updated (diff)
#2

Updated by Stig Nørgaard Færch almost 2 years ago

  • Category set to Link Handling, Site Handling & Routing
#3

Updated by Stig Nørgaard Færch almost 2 years ago

  • Tracker changed from Bug to Feature
#4

Updated by Stig Nørgaard Færch almost 2 years ago

Changed form bug to feature. But actually I'm now not sure which it should be, as the docs does not describe that it should not work on import definitions.

#5

Updated by Andreas Fernandez almost 2 years ago

I think "Bug" is fine since I'd expect this as well.

#6

Updated by Stig Nørgaard Færch almost 2 years ago

  • Tracker changed from Feature to Bug
  • TYPO3 Version set to 9

Changing back to bug from feature.

#7

Updated by Stig Nørgaard Færch almost 2 years ago

Andreas Fernandez wrote:

I think "Bug" is fine since I'd expect this as well.

I would like to know from some core team member, if this something that I can expect being fixed at some point for 9LTS?
If yes, I will patch for now. If not, I need to find some other (probably not as nice) solution.

#8

Updated by Gerrit Code Review almost 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61955

#9

Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61955

#10

Updated by Gerrit Code Review almost 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61955

#11

Updated by Gerrit Code Review almost 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61955

#12

Updated by Gerrit Code Review almost 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61955

#13

Updated by Gerrit Code Review almost 2 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61955

#14

Updated by Andreas Fernandez almost 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#15

Updated by Stig Nørgaard Færch almost 2 years ago

Andreas Fernandez wrote:

Applied in changeset ba50c94e87746fbcccf9f10e4e14f5de22fefba3.

I can see that this has been fixed for CMS 10, but not CMS 9. Will this not be applied for CMS 9 as well?

#16

Updated by Benni Mack almost 2 years ago

  • Status changed from Resolved to Closed
#17

Updated by Susanne Moog over 1 year ago

  • Has duplicate Feature #89410: Placeholders for YAML import statement added

Also available in: Atom PDF