Skip to content

Symfony 4 support #318

@Gemorroj

Description

@Gemorroj
Contributor

Need add Symfony 4 support

Activity

softwarebycg

softwarebycg commented on Jan 22, 2018

@softwarebycg
Collaborator

For anyone who's interested, I've got the bundle working in Symfony 4 in a very 'hacky' way.
Good for a short-term patch/solution.

See the basic installation instructions on how to get bundle overrides for templates working in Symfony 4 with this, that was the only major hurdle I had after changing the installation requirements and renaming template locations to match Symfony 4.

https://github.com/hex333ham/FOSMessageBundle/tree/symfony4

kubaceg

kubaceg commented on Jan 30, 2018

@kubaceg

I need it too :) Hacky way from @hairybobbins don't work for me, composer can't resolve paths.

softwarebycg

softwarebycg commented on Jan 30, 2018

@softwarebycg
Collaborator

@kubaceg Can you post the full error message from composer please?

kubaceg

kubaceg commented on Jan 30, 2018

@kubaceg

Hi, from user entity

Fatal error: Interface 'FOS\MessageBundle\Model\ParticipantInterface' not found in /var/www/symfony/src/Entity/User/User.php on line 10

I'm thinking now that probably after my changes in composer.json (repository + new bundle) and composer install command nothing happens. I must check it once again

softwarebycg

softwarebycg commented on Jan 31, 2018

@softwarebycg
Collaborator

@kubaceg It looks to me like your application is failing before it reaches composer, it might be worth commenting out that reference then seeing if it works.

softwarebycg

softwarebycg commented on Mar 13, 2018

@softwarebycg
Collaborator

@kubaceg hey, just realised that target-dir was accidentally removed in the composer.json file due to the deprecation of psr-0, this means that if you move the hacky versions code under the correct directory structure within the bundle (FOS\MessageBundle) it will work.

If anyone knows of a way to fix this please let me know, I'll be researching the problem but I am not the best when it comes to composer.

if you're experiencing issues, run composer require friendsofsymfony/message-bundle:dev-symfony4, this will reload the package and has fixed all issues on my end

kubaceg

kubaceg commented on Mar 14, 2018

@kubaceg

Thanks! I'll try it :)

kubaceg

kubaceg commented on Mar 18, 2018

@kubaceg

It works fine :) only what I have to do was add own entities mapping in yaml + define aliases:

    fos_user.user_to_username_transformer:
        alias: App\Service\UserToUsernameTransformer

    FOS\MessageBundle\Composer\Composer: '@fos_message.composer'

    FOS\MessageBundle\Sender\Sender: '@fos_message.sender'
softwarebycg

softwarebycg commented on Apr 3, 2018

@softwarebycg
Collaborator

@kubaceg good spot, I'll add these notes to the install instructions on my fork later

cheers!

afranioce

afranioce commented on Apr 6, 2018

@afranioce
Contributor

@hairybobbins I'm using your fork but it's giving the service error

The "fos_message.provider" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.

afranioce

afranioce commented on Apr 6, 2018

@afranioce
Contributor

It ran when I put the services as public in the class FOS\MessageBundle\DependencyInjection\FOSMessageExtension.php

Ex.:

class FOSMessageExtension extends Extension
{
//...
    $container->setAlias('fos_message.message_manager', new Alias($config['message_manager'], true));
//...
}

https://pastebin.com/1LWseFuu

ChanOmegaWebDesign

ChanOmegaWebDesign commented on Apr 12, 2018

@ChanOmegaWebDesign

@hairybobbins I just submitted a pull request to your fork implementing the fix by @afranioce for all the Aliases.

phtmgt

phtmgt commented on Apr 20, 2018

@phtmgt

Thanks for all the suggestions. I used these to get the bundle to work, but now I can't get it to use my custom twig templates. In Symfony 4 they should be placed in /templates/bundles/... Unfortunately, this does not work at all. Any suggestions?

ChanOmegaWebDesign

ChanOmegaWebDesign commented on Apr 20, 2018

@ChanOmegaWebDesign

capture
@finkbg This works for me, edit "templates/bundles/FOSMessageBundle/layout.html.twig" to extend your base template. Then change the extends path in the other files (templates/bundles/FOSMessageBundle/Message/.) to
{% extends 'bundles/FOSMessageBundle/layout.html.twig' %}
What errors are you getting?

14 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @kubaceg@Gemorroj@afranioce@ChanOmegaWebDesign@GuilhemN

        Issue actions

          Symfony 4 support · Issue #318 · FriendsOfSymfony/FOSMessageBundle