Project

General

Profile

Actions

Bug #102991

closed

DDEV, Extension Development and Translations not working with TYPO3_PATH_APP set

Added by Marcus Schwemer 10 months ago. Updated 5 months ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
composer
Target version:
-
Start date:
2024-01-30
Due date:
% Done:

0%

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

Description

For many of our extensions we use a ddev setup for development purposes. For example https://github.com/in2code-de/publications

TYPO3 and the is completely setup under .build using the env variable TYPO3_PATH_APP set to /var/www/html/.build. The installation works basically fine, including the translations of the core.

But the translation delivered with the extension are not displayed. Always the default language (english) is shown.

Howto reproduce

The is true in the backend, if you add the german language and switch the be user to german ... the english labels are still used.

(If you are asking, why the initial setup is with the german language. It has historical reasons and will be changed some when ... ;-) )

It could be related to https://forge.typo3.org/issues/101334, which sounds quite similar.


Files

Bildschirmfoto vom 2024-01-30 09-17-52.png (38.8 KB) Bildschirmfoto vom 2024-01-30 09-17-52.png Screenshot 1: Translation does not work Marcus Schwemer, 2024-01-30 08:18
Bildschirmfoto vom 2024-01-26 17-40-39.png (57.3 KB) Bildschirmfoto vom 2024-01-26 17-40-39.png Screenshot 2: Translation works Marcus Schwemer, 2024-01-30 08:21

Updated by Marcus Schwemer 10 months ago

If using the environment variable the l10n cache in .build/var/cache/data/l10n does not contain the translation (Screenshot 1).

If the env variable is not set, the cache is under var/cache/ and the l10 cache includes the german translation. (Screenshot 2).

Actions #2

Updated by Stefan Bürk 10 months ago

  • Status changed from New to Needs Feedback

Instead of setting the `TYPO3_PATH_APP` environment variable directly,
have you tried to use following in your extension composer.json to
setup the TYPO3 installation ?

{
    "config": {
        "allow-plugins": {
            "typo3/class-alias-loader": true,
            "typo3/cms-composer-installers": true
        },
        "bin-dir": ".Build/bin",
        "vendor-dir": ".Build/vendor",
    },
    "extra": {
        "typo3/cms": {
            "extension-key": "your_extension_key",
            "web-dir": ".Build/Web" 
        }
    },  
}

That will create a full TYPO3 composer based installation in `.Build/` with `./Build/Web` as "public" folder (document root for ddev for the domain)
and properly bootstrap all path calculations properly ?

At least, this is what we normally use for extensions development (and I'm settupt up my local apache2 on ./Build/Web and never detected an issue.

I'd would stay away of manipulating these environment variables by hand as there are multiple involved and can lead to undesired effects.

Actions #3

Updated by Marcus Schwemer 10 months ago · Edited

Yes, we have the composer setting like you mentioned it.

But then the directories "var" and "config" will not be in the .Build folder, but in the project root. This is the thing, we want to prevent.

Actions #4

Updated by Garvin Hicking 5 months ago

  • Category set to System/Bootstrap/Configuration
  • Tags set to TYPO3_PATH_APP
Actions #5

Updated by Helmut Hummel 5 months ago

  • Category changed from System/Bootstrap/Configuration to composer
  • Status changed from Needs Feedback to Rejected

Marcus Schwemer wrote in #note-3:

Yes, we have the composer setting like you mentioned it.

But then the directories "var" and "config" will not be in the .Build folder, but in the project root. This is the thing, we want to prevent.

That is impossible since TYPO3 v12 (composer installers 4). Setting the env var lead to exactly the unexpected behaviour you are describing.

The config and var folder have non configurable locations for now.

When I started re-configuring my extensions to have everything located in a .build folder, this was only due to tooling not being able so set exclude paths for uploading to TER, but auto excluding dot files and folders.

Nowadays this is a cosmetic issue. I see good reasons to stick to the defaults, especially since extensions can be the root for a complete TYPO3 project instance.

So what I rather have in mind and what I think makes sense, is making any resource path configurable, beeing it "Configuration/TCA", "Resources/Public" or, "config/sites" or (not really a resource, but could be handled similarly in this context) "var/log"

The whole TYPO3_PATH_* env vars should rather vanish so that it won't be possible any more to break an installation by setting wrong values there.

Actions

Also available in: Atom PDF