New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing a module that relies on CacheItemPoolInterface #1816

Open
jeroendesloovere opened this Issue Oct 28, 2016 · 7 comments

Comments

Projects
None yet
3 participants
@jeroendesloovere
Member

jeroendesloovere commented Oct 28, 2016

Type

  • Non critical bug

Problem description

When installing Fork CMS, it seems that you can't install a custom module that relies on "cache.pool"? The strange thing is dat the Pages module has the same but doesn't throw an error?

Catchable Fatal Error: Argument 2 passed to Backend\Modules\MediaLibrary\Engine\CacheBuilder::__construct() must be an instance of Psr\Cache\CacheItemPoolInterface, instance of stdClass given, called in /Sites/fork-cms-4-3/app/cache/install/appInstallDebugProjectContainer.php on line 1841 and defined

schermafbeelding 2016-10-28 om 16 53 30

services:
    media_library.cache_builder:
        class: Backend\Modules\MediaLibrary\Engine\CacheBuilder
        arguments:
            - "@database"
            - "@cache.pool"
            - "@media_library.repository.group"

Steps to reproduce

Describe how we can reproduce the problem here

Expected behavior / Proposed solutions

explain what you had expected to happen and or a solution

@carakas

This comment has been minimized.

Show comment
Hide comment
@carakas

carakas Nov 16, 2016

Member

@jeroendesloovere can you provide more info?

Member

carakas commented Nov 16, 2016

@jeroendesloovere can you provide more info?

@jeroendesloovere

This comment has been minimized.

Show comment
Hide comment
@jeroendesloovere

jeroendesloovere Nov 16, 2016

Member

You can reproduce as follows:
Possibility 1:
Install a new Fork CMS with the MediaLibrary Module. How to install MediaLibrary module

Possibility 2:

Member

jeroendesloovere commented Nov 16, 2016

You can reproduce as follows:
Possibility 1:
Install a new Fork CMS with the MediaLibrary Module. How to install MediaLibrary module

Possibility 2:

@carakas

This comment has been minimized.

Show comment
Hide comment
@carakas

carakas Nov 16, 2016

Member

why do you need the cache in the installer? Looks to me like this is more an issue with the media module

Member

carakas commented Nov 16, 2016

why do you need the cache in the installer? Looks to me like this is more an issue with the media module

@jeroendesloovere

This comment has been minimized.

Show comment
Hide comment
@jeroendesloovere

jeroendesloovere Nov 16, 2016

Member

No, that's not what I meant.
I didn't need it in the installer,
but in the module its services.yml.

Member

jeroendesloovere commented Nov 16, 2016

No, that's not what I meant.
I didn't need it in the installer,
but in the module its services.yml.

@jeroendesloovere

This comment has been minimized.

Show comment
Hide comment
@jeroendesloovere

jeroendesloovere Mar 13, 2017

Member

@carakas This is the bug that I mentioned last week.
stdClass...

Member

jeroendesloovere commented Mar 13, 2017

@carakas This is the bug that I mentioned last week.
stdClass...

@carakas

This comment has been minimized.

Show comment
Hide comment
@carakas

carakas Mar 13, 2017

Member

at the moment this is a bit a hard bug to solve. Probably only will be fixed when we clean this one up

Member

carakas commented Mar 13, 2017

at the moment this is a bit a hard bug to solve. Probably only will be fixed when we clean this one up

@StijnVrolijk StijnVrolijk added this to the 6.0.0 milestone Mar 27, 2017

@jeroendesloovere

This comment has been minimized.

Show comment
Hide comment
@jeroendesloovere

jeroendesloovere Apr 10, 2017

Member

Just bumped upon another example of this problem
Travis throws errors if you have used f.e.: "@fork.settings" in a service.
schermafbeelding 2017-04-10 om 10 55 08

Would happen also if you used "@cache.pool".

The only temporary solution is to change the code from

/**
 * @param ModulesSettings $settings
 */
public function __construct(ModulesSettings $settings) {}

to the following:

/**
 * @param ModulesSettings|\stdClass $settings
 */
public function __construct($settings) {}

Which is obviously less good code.

Member

jeroendesloovere commented Apr 10, 2017

Just bumped upon another example of this problem
Travis throws errors if you have used f.e.: "@fork.settings" in a service.
schermafbeelding 2017-04-10 om 10 55 08

Would happen also if you used "@cache.pool".

The only temporary solution is to change the code from

/**
 * @param ModulesSettings $settings
 */
public function __construct(ModulesSettings $settings) {}

to the following:

/**
 * @param ModulesSettings|\stdClass $settings
 */
public function __construct($settings) {}

Which is obviously less good code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment