Skip to content
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

Bundle not working with Symfony version prior to 3.3 #27

Open
hknezevic opened this issue Sep 15, 2019 · 0 comments
Open

Bundle not working with Symfony version prior to 3.3 #27

hknezevic opened this issue Sep 15, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@hknezevic
Copy link
Member

hknezevic commented Sep 15, 2019

Installing the package via composer passes because there is no require statement on the symfony version, only the ezsystems/ezpublish-kernel.

However, some compiler passes, which are enabled by default, call the Definition method setArgument(), which was added in the Symfony 3.3 and not available in the prior Symfony versions:

https://github.com/netgen/ezplatform-search-extra/blob/master/lib/Container/Compiler/FieldType/RichTextIndexablePass.php#L34

https://github.com/netgen/ezplatform-search-extra/blob/master/lib/Container/Compiler/FieldType/XmlTextIndexablePass.php#L32

https://github.com/netgen/ezplatform-search-extra/blob/master/lib/Container/Compiler/FieldTypeRegistryPass.php#L29

If I manually disable these compiler passes, the rest of the features work nicely, as far as I could tell.

It would be nice if we somehow managed to make this compatible with the Symfony 2.8-3.3, so that we don't lock out the possibility of using this package on the older version of eZ prior to 6.12.

I guess something like this would do (e.g. for the FieldTypeRegistryPass):

if (count($fieldTypeRegistry->getArguments()) > 0) {
    $fieldTypeRegistry->replaceArgument(0, $fieldTypeRegistryClass);
}
else{
    $fieldTypeRegistry->addArgument($fieldTypeRegistryClass);
}

If you agree with this approach, I will open a PR. Otherwise we need to lock out the symfony version in the composer.json.

cc @MarioBlazek @emodric @pspanja

@hknezevic hknezevic added the bug Something isn't working label Sep 15, 2019
@pspanja pspanja self-assigned this Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants