Project

General

Profile

Actions

Bug #105504

closed

styleguide: Dependency Injection fails with classic TYPO3 installation

Added by Franz Holzinger 4 months ago. Updated 3 months ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2024-10-28
Due date:
% Done:

0%

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

Description

After an activation of the latest styleguide 13.4.1 the backend is gone with an error message.

  • Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
    Expected to find class "TYPO3\CMS\Styleguide\Command\GeneratorCommand" in file "/path/demoshop13/typo3conf/ext/styleguide/Classes/Command/GeneratorCommand.php" while importing services from resource "../Classes/*", but it was not found! Check the namespace prefix used with the resource.*

Files

styleguide-backtrace.txt (4.28 KB) styleguide-backtrace.txt Franz Holzinger, 2024-10-28 17:27
TYPO3-13-Styleguide-Activation.png (86.1 KB) TYPO3-13-Styleguide-Activation.png Franz Holzinger, 2024-10-28 17:27
Actions #1

Updated by Garvin Hicking 4 months ago

  • Category changed from Documentation to Miscellaneous
  • Status changed from New to Needs Feedback

Hi!

Can you please give more details, what environment are you using here? How are you using the 13.4.1 version of TYPO3 in classic mode, did you create your own tarball? Or are you trying to use styleguide in 13.4.1-dev (there's no 13.4.1 yet) in a 13.4.0 environment?! Also, EXT:styleguide is only available in a 12.4 compatible version from TER...

Regards,
Garvin

Actions #2

Updated by Franz Holzinger 3 months ago

I use the Github environment to download the extension stylesheet. Then I use the FTP to copy it to the server where I activate it in the EM.

I have tried it again with Tag v13.1.1.

But now comes this error:

Fatal error: Type of TYPO3\CMS\Styleguide\TcaDataGenerator\FieldGenerator\TypePassthroughFieldL10nSource::$matchArray must not be defined (as in class TYPO3\CMS\Styleguide\TcaDataGenerator\FieldGenerator\AbstractFieldGenerator) in /path/typo3conf/ext/styleguide/Classes/TcaDataGenerator/FieldGenerator/TypePassthroughFieldL10nSource.php on line 27

Actions #3

Updated by Garvin Hicking 3 months ago

Please use exactly the tag of your matching TYPO3 core version, in this case this should be 13.4.0.

The Github repo however is aimed at providing the composer package, I'm not really this core-maintained extension can be simply copied like that, because it might have different core usage than a "normal" extension would have.

But I have no experience with styleguide in a legacy environment. I think probably EXT:styleguide should be bundled with the TYPO3 tarball...

Actions #4

Updated by Oliver Hader 3 months ago ยท Edited

ext:styleguide is not bundled in the tarball, and excluded during packaging https://github.com/TYPO3/darth/blob/78ddadc46dc4cc66f91c8953b0c48e9fd2e02d29/conf/release.yaml#L95-L96

I tried installing the extension from GitHub exports, e.g.

However that also failed on my side with Class "TYPO3\CMS\Styleguide\TcaDataGenerator\RecordFinder" not found when accessing the Styleguide backend module.

I don't have much time right now to dig deeper. Maybe @Christian Kuhn can help here...

Actions #5

Updated by Franz Holzinger 3 months ago

I have now used the tag v13.0.1, but as expected there is no difference. I rather think that the latest tag v13.1.1 uses the most recent code.

I have ignored this requirement, because I use TYPO3 13.4.0.

"require": {
"typo3/cms-core": "13.0.1"
},
Actions #6

Updated by Franz Holzinger 3 months ago

I have used the wrong tag.

Now comes a test with tag v13.4.0:
Only this error happens in the backend module:

Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
Expected to find class "TYPO3\CMS\Styleguide\Command\GeneratorCommand" in file "/path/demoshop13/typo3conf/ext/styleguide/Classes/Command/GeneratorCommand.php" while importing services from resource "../Classes/*", but it was not found! Check the namespace prefix used with the resource.
in /path/typo3_src-13.4.0/vendor/symfony/dependency-injection/Loader/FileLoader.php line 338
Actions #7

Updated by Benni Mack 3 months ago

  • Status changed from Needs Feedback to Rejected

Dear Franz,

this way is officially not supported. However, if you really want to make it work, please change the "type" in EXT:styleguide's composer.json from "typo3-cms-framework" to "typo3-cms-extension" when using a system extension in typo3conf/ext and in classic mode. Be sure to run typo3/sysext/core/bin/typo3 dumpautoload afterwards.

We won't support this approach (styleguide in classic mode) in the future, as this extension is used for running TYPO3 Core tests and debugging for core development.

Actions

Also available in: Atom PDF