From 32790d9788a4c6d8a1e6d543242f15f5a2093ba1 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 15 Aug 2018 10:43:12 +0200 Subject: [PATCH] Create page that replace the "home" folder Now it works in different languages and portals. --- composer.json | 3 +- config/bundles.php | 1 + config/packages/lunetics_locale.yaml | 70 +++++++++ config/packages/sonata_page.yaml | 4 +- config/services.yaml | 1 - main/admin/configure_homepage.php | 2 +- main/admin/configure_inscription.php | 4 +- main/auth/inscription.php | 2 +- main/inc/lib/course.lib.php | 1 - main/inc/lib/sessionmanager.lib.php | 10 +- src/CoreBundle/Controller/IndexController.php | 73 +-------- .../EventListener/LegacyListener.php | 6 +- .../EventListener/LocaleListener.php | 47 +++--- src/CoreBundle/Framework/Container.php | 29 +++- .../views/Admin/switcher_links.html.twig | 60 +++++--- .../Resources/views/Index/index.html.twig | 2 +- .../views/Index/inscription_edit.html.twig | 11 -- .../{welcome.html.twig => page.html.twig} | 2 +- .../Resources/views/Index/page_edit.html.twig | 15 ++ .../views/Index/welcome_edit.html.twig | 11 -- src/PageBundle/Controller/PageController.php | 145 ++++++++++++++++-- .../Resources/views/Sidebar/login.html.twig | 42 ++--- src/UserBundle/Entity/User.php | 2 +- 23 files changed, 352 insertions(+), 191 deletions(-) create mode 100644 config/packages/lunetics_locale.yaml delete mode 100644 src/CoreBundle/Resources/views/Index/inscription_edit.html.twig rename src/CoreBundle/Resources/views/Index/{welcome.html.twig => page.html.twig} (75%) create mode 100644 src/CoreBundle/Resources/views/Index/page_edit.html.twig delete mode 100644 src/CoreBundle/Resources/views/Index/welcome_edit.html.twig diff --git a/composer.json b/composer.json index 800bc5fd20..65b0fbb725 100755 --- a/composer.json +++ b/composer.json @@ -154,7 +154,8 @@ "knplabs/knp-menu-bundle": "^2.0", "symfony/requirements-checker": "^1.1", "liip/theme-bundle": "^1.5", - "a2lix/translation-form-bundle": "^3.0" + "a2lix/translation-form-bundle": "^3.0", + "lunetics/locale-bundle": "^2.6" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.7", diff --git a/config/bundles.php b/config/bundles.php index 6d6b1770cd..982402c4de 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -68,4 +68,5 @@ return [ A2lix\AutoFormBundle\A2lixAutoFormBundle::class => ['all' => true], A2lix\TranslationFormBundle\A2lixTranslationFormBundle::class => ['all' => true], Ivory\CKEditorBundle\IvoryCKEditorBundle::class => ['all' => true], + Lunetics\LocaleBundle\LuneticsLocaleBundle::class => ['all' => true], ]; diff --git a/config/packages/lunetics_locale.yaml b/config/packages/lunetics_locale.yaml new file mode 100644 index 0000000000..96c126b4b5 --- /dev/null +++ b/config/packages/lunetics_locale.yaml @@ -0,0 +1,70 @@ +lunetics_locale: + guessing_order: + - query + - session + - cookie + - browser + - router + switcher: + show_current_locale: true + allowed_locales: # From DB table languages + - 'ar' + - 'ast' + - 'eu' + - 'bn' + - 'bs' + - 'pt-BR' + - 'bg' + - 'ca' + - 'hr' + - 'cs' + - 'da' + - 'prs' + - 'nl' + - 'en' + - 'eo' + - 'fo' + - 'fi' + - 'fr' + - 'fur' + - 'gl' + - 'ka' + - 'de' + - 'el' + - 'he' + - 'hi' + - 'hu' + - 'id' + - 'it' + - 'ja' + - 'ko' + - 'lv' + - 'lt' + - 'mk' + - 'ms' + - 'no' + - 'oc' + - 'ps' + - 'fa' + - 'pl' + - 'pt' + - 'qu' + - 'ro' + - 'ru' + - 'sr' + - 'zh' + - 'sk' + - 'sl' + - 'so' + - 'es' + - 'sw' + - 'sv' + - 'tl' + - 'th' + - 'bo' + - 'zh-TW' + - 'tr' + - 'uk' + - 'vi' + - 'xh' + - 'yo' diff --git a/config/packages/sonata_page.yaml b/config/packages/sonata_page.yaml index f752adc408..2a8a22f6f2 100644 --- a/config/packages/sonata_page.yaml +++ b/config/packages/sonata_page.yaml @@ -33,6 +33,7 @@ sonata_page: - ^/_profiler/(.*) - ^/userportal - ^/userportal/(.*) + - ^/internal_page/(.*) - ^/js/(.*) - ^/faq/(.*) - ^/faq @@ -48,8 +49,7 @@ sonata_page: - sylius_flow(.*) ignore_routes: - home - - edit_welcome - - edit_inscription + - internal_page - elfinder - login - logout diff --git a/config/services.yaml b/config/services.yaml index 688584d2b3..64d19d7b2c 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -14,7 +14,6 @@ services: exclude: '../src/PageBundle/{Entity,Migrations,Tests}' public: true - # Put parameters here that don't need to change on each machine where the app is deployed # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration parameters: diff --git a/main/admin/configure_homepage.php b/main/admin/configure_homepage.php index a37d943012..947da06f83 100755 --- a/main/admin/configure_homepage.php +++ b/main/admin/configure_homepage.php @@ -1122,7 +1122,7 @@ switch ($action) {
diff --git a/main/admin/configure_inscription.php b/main/admin/configure_inscription.php index 74bc70911f..81cf297b64 100755 --- a/main/admin/configure_inscription.php +++ b/main/admin/configure_inscription.php @@ -155,7 +155,6 @@ if (!empty($action)) { } }*/ - $form = new FormValidator('registration'); if (api_get_setting('allow_terms_conditions') === 'true') { $display_all_form = !isset($_SESSION['update_term_and_condition']['user_id']); @@ -354,11 +353,12 @@ if (!empty($_GET['openid_msg']) && $_GET['openid_msg'] == 'idnotfound') { $content .= Display::return_message(get_lang('OpenIDCouldNotBeFoundPleaseRegister'), 'warning'); } +$url = api_get_path(WEB_PUBLIC_PATH).'internal_page/edit/inscription'; //Form of language //$content .= api_display_language_form(); $content .= '  '. Display::return_icon('edit.gif', get_lang('Edit')).' - '.get_lang('EditNotice').''; + '.get_lang('EditNotice').''; $content .= $form->returnForm(); diff --git a/main/auth/inscription.php b/main/auth/inscription.php index eeed47c88b..606be20e75 100755 --- a/main/auth/inscription.php +++ b/main/auth/inscription.php @@ -1,8 +1,8 @@ forward( - 'Chamilo\PageBundle\Controller\PageController:createPage', - array('pageSlug' => 'welcome') - ); - } - - /** - * The Chamilo index home page. - * - * @Route("/edit_inscription", name="edit_inscription") - * @Method({"GET|POST"}) - * @Security("has_role('ROLE_ADMIN')") - * - * @return Response - */ - public function editInscriptionAction() - { - $redirect = $this->generateUrl('legacy_main', ['name' => 'admin/configure_inscription.php']); - - return $this->forward( - 'Chamilo\PageBundle\Controller\PageController:createPage', - array('pageSlug' => 'inscription', 'redirect' => $redirect) - ); - - } - - /** - * The Chamilo index home page. - * - * @Route("/welcome", name="welcome") - * @Method({"GET"}) - * - * @return Response - */ - public function welcomeAction() - { - $siteSelector = $this->get('sonata.page.site.selector'); - $site = $siteSelector->retrieve(); - $page = null; - if ($site) { - $pageManager = $this->get('sonata.page.manager.page'); - // Parents only of homepage - $criteria = ['site' => $site, 'enabled' => true, 'parent' => 1, 'slug' => 'welcome']; - /** @var Page $page */ - $page = $pageManager->findOneBy($criteria); - } - - return $this->render( - '@ChamiloCore/Index/welcome.html.twig', - [ - 'page' => $page, - 'content' => 'welcome', - ] - ); - } - /** * The Chamilo index home page. * @@ -108,7 +41,7 @@ class IndexController extends BaseController * * @return Response */ - public function indexAction(Request $request) + public function indexAction(Request $request): Response { /** @var \PageController $pageController */ //$pageController = $this->get('page_controller'); @@ -184,13 +117,13 @@ class IndexController extends BaseController * * @return Response */ - public function toggleStudentViewAction(Request $request) + public function toggleStudentViewAction(Request $request): Response { if (!api_is_allowed_to_edit(false, false, false, false)) { return ''; } $studentView = $request->getSession()->get('studentview'); - if (empty($studentView) || $studentView == 'studentview') { + if (empty($studentView) || $studentView === 'studentview') { $request->getSession()->set('studentview', 'teacherview'); return 'teacherview'; diff --git a/src/CoreBundle/EventListener/LegacyListener.php b/src/CoreBundle/EventListener/LegacyListener.php index 937bc8e03d..310ba2b8db 100644 --- a/src/CoreBundle/EventListener/LegacyListener.php +++ b/src/CoreBundle/EventListener/LegacyListener.php @@ -100,7 +100,11 @@ class LegacyListener $twig->addGlobal($index, $value); } - $userObject = $container->get('security.token_storage')->getToken()->getUser(); + $token = $container->get('security.token_storage')->getToken(); + $userObject = null; + if ($token !== null) { + $userObject = $container->get('security.token_storage')->getToken()->getUser(); + } $userInfo = []; $userInfo['is_anonymous'] = true; diff --git a/src/CoreBundle/EventListener/LocaleListener.php b/src/CoreBundle/EventListener/LocaleListener.php index 16ed97c5f0..27b925cfc4 100644 --- a/src/CoreBundle/EventListener/LocaleListener.php +++ b/src/CoreBundle/EventListener/LocaleListener.php @@ -30,7 +30,7 @@ class LocaleListener implements EventSubscriberInterface /** * @param string $defaultLocale */ - public function __construct($defaultLocale = 'en', $container) + public function __construct($defaultLocale, $container) { $this->defaultLocale = $defaultLocale; $this->container = $container; @@ -55,23 +55,8 @@ class LocaleListener implements EventSubscriberInterface } $request = $event->getRequest(); - $courseCode = $request->get('course'); - // Detect if the course was set with a cidReq: - if (empty($courseCode)) { - $courseCodeFromRequest = $request->get('cidReq'); - $courseCode = $courseCodeFromRequest; - } - - /** @var EntityManager $em */ - $em = $container->get('doctrine')->getManager(); - - if (!empty($courseCode)) { - /** @var Course $course */ - $course = $em->getRepository('ChamiloCoreBundle:Course')->findOneByCode($courseCode); - } - - // try to see if the locale has been set as a _locale routing parameter + // Try to see if the locale has been set as a _locale routing parameter (from lang switcher) if ($locale = $request->attributes->get('_locale')) { $request->getSession()->set('_locale', $locale); } else { @@ -92,11 +77,27 @@ class LocaleListener implements EventSubscriberInterface } // 3. Check course locale - /** @var Course $course */ - if (!empty($course)) { - $courseLocale = $course->getCourseLanguage(); - if (!empty($courseLocale)) { - $locale = $courseLocale; + $courseCode = $request->get('course'); + + // Detect if the course was set with a cidReq: + if (empty($courseCode)) { + $courseCodeFromRequest = $request->get('cidReq'); + $courseCode = $courseCodeFromRequest; + } + + /** @var EntityManager $em */ + $em = $container->get('doctrine')->getManager(); + + if (!empty($courseCode)) { + /** @var Course $course */ + $course = $em->getRepository('ChamiloCoreBundle:Course')->findOneByCode($courseCode); + // 3. Check course locale + /** @var Course $course */ + if (!empty($course)) { + $courseLocale = $course->getCourseLanguage(); + if (!empty($courseLocale)) { + $locale = $courseLocale; + } } } @@ -119,7 +120,7 @@ class LocaleListener implements EventSubscriberInterface { return [ // must be registered before the default Locale listener - KernelEvents::REQUEST => [['onKernelRequest', 17]], + KernelEvents::REQUEST => [['onKernelRequest', 20]], ]; } } diff --git a/src/CoreBundle/Framework/Container.php b/src/CoreBundle/Framework/Container.php index 0952abdba4..706028d36c 100644 --- a/src/CoreBundle/Framework/Container.php +++ b/src/CoreBundle/Framework/Container.php @@ -428,14 +428,27 @@ class Container public static function getPage($slug) { $container = self::$container; - $siteSelector = $container->get('sonata.page.site.selector'); - $site = $siteSelector->retrieve(); - - $pageManager = $container->get('sonata.page.manager.page'); - // Parents only of homepage - $criteria = ['site' => $site, 'enabled' => true, 'parent' => 1, 'slug' => $slug]; - /** @var Page $page */ - $page = $pageManager->findOneBy($criteria); + /*$siteSelector = $container->get('sonata.page.site.selector'); + $site = $siteSelector->retrieve();*/ + $siteManager = $container->get('sonata.page.manager.site'); + $request = Container::getRequest(); + $page = null; + if ($request) { + $host = $request->getHost(); + $criteria = [ + 'locale' => $request->getLocale(), + 'host' => $host, + ]; + $site = $siteManager->findOneBy($criteria); + + $pageManager = $container->get('sonata.page.manager.page'); + // Parents only of homepage + $criteria = ['site' => $site, 'enabled' => true, 'slug' => $slug]; + /** @var Page $page */ + $page = $pageManager->findOneBy($criteria); + + return $page; + } return $page; } diff --git a/src/CoreBundle/Resources/views/Admin/switcher_links.html.twig b/src/CoreBundle/Resources/views/Admin/switcher_links.html.twig index a00ecdf413..a27b125ae6 100644 --- a/src/CoreBundle/Resources/views/Admin/switcher_links.html.twig +++ b/src/CoreBundle/Resources/views/Admin/switcher_links.html.twig @@ -1,22 +1,44 @@ - + + +{##} diff --git a/src/CoreBundle/Resources/views/Index/index.html.twig b/src/CoreBundle/Resources/views/Index/index.html.twig index 78e0165039..013bf6246a 100644 --- a/src/CoreBundle/Resources/views/Index/index.html.twig +++ b/src/CoreBundle/Resources/views/Index/index.html.twig @@ -2,7 +2,7 @@ {% block chamilo_right_column %} {% autoescape false %} - {{ render(controller('ChamiloCoreBundle:Index:welcome')) }} + {{ render(controller('ChamiloPageBundle:Page:renderPage', {'slug': 'welcome'} )) }} {{ announcements_block }} {{ content }} diff --git a/src/CoreBundle/Resources/views/Index/inscription_edit.html.twig b/src/CoreBundle/Resources/views/Index/inscription_edit.html.twig deleted file mode 100644 index a01e5c991d..0000000000 --- a/src/CoreBundle/Resources/views/Index/inscription_edit.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "@ChamiloTheme/Layout/layout_two_col.html.twig" %} - -{% block chamilo_right_column %} - -Edit inscription! - -{{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }} -{{ form_widget(form) }} -{{ form_end(form) }} - -{% endblock %} \ No newline at end of file diff --git a/src/CoreBundle/Resources/views/Index/welcome.html.twig b/src/CoreBundle/Resources/views/Index/page.html.twig similarity index 75% rename from src/CoreBundle/Resources/views/Index/welcome.html.twig rename to src/CoreBundle/Resources/views/Index/page.html.twig index b9a165165e..ca38fef067 100644 --- a/src/CoreBundle/Resources/views/Index/welcome.html.twig +++ b/src/CoreBundle/Resources/views/Index/page.html.twig @@ -1,5 +1,5 @@ {% if is_granted('ROLE_ADMIN') %} - + {{ "header.edit_page"|trans({}, 'SonataPageBundle') }} {% endif %} diff --git a/src/CoreBundle/Resources/views/Index/page_edit.html.twig b/src/CoreBundle/Resources/views/Index/page_edit.html.twig new file mode 100644 index 0000000000..f382e45e26 --- /dev/null +++ b/src/CoreBundle/Resources/views/Index/page_edit.html.twig @@ -0,0 +1,15 @@ +{% extends "@ChamiloTheme/Layout/layout_two_col.html.twig" %} + +{% block chamilo_right_column %} + +{{ locale_switcher(null, null, 'ChamiloCoreBundle:Admin:switcher_links.html.twig') }} + +Edit page '{{ page.slug }}' in '{{ page.site.locale }}' + +{{ sonata_page_render_container('content', page) }} + +{{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }} +{{ form_widget(form) }} +{{ form_end(form) }} + +{% endblock %} \ No newline at end of file diff --git a/src/CoreBundle/Resources/views/Index/welcome_edit.html.twig b/src/CoreBundle/Resources/views/Index/welcome_edit.html.twig deleted file mode 100644 index 9aa5841434..0000000000 --- a/src/CoreBundle/Resources/views/Index/welcome_edit.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "@ChamiloTheme/Layout/layout_two_col.html.twig" %} - -{% block chamilo_right_column %} - -Edit welcome! - -{{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }} -{{ form_widget(form) }} -{{ form_end(form) }} - -{% endblock %} \ No newline at end of file diff --git a/src/PageBundle/Controller/PageController.php b/src/PageBundle/Controller/PageController.php index cbbb26340f..5e3cfcd65a 100644 --- a/src/PageBundle/Controller/PageController.php +++ b/src/PageBundle/Controller/PageController.php @@ -6,7 +6,10 @@ namespace Chamilo\PageBundle\Controller; use Chamilo\CoreBundle\Controller\BaseController; use Chamilo\PageBundle\Entity\Page; use Chamilo\PageBundle\Entity\Snapshot; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Sonata\PageBundle\Entity\PageManager; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Ivory\CKEditorBundle\Form\Type\CKEditorType; use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait; @@ -57,15 +60,74 @@ class PageController extends BaseController } /** + * Creates a site if needed checking the host and locale. + * Creates a first root page. + * Creates a page if it doesn't exists. + * Updates the page if page exists. + * * @param string $pageSlug + * @param string $redirect * @param Request $request * * @return \Symfony\Component\HttpFoundation\RedirectResponse|Response */ public function createPage($pageSlug, $redirect, Request $request) { - $siteSelector = $this->container->get('sonata.page.site.selector'); - $site = $siteSelector->retrieve(); + $container = $this->container; + //$siteSelector = $container->get('sonata.page.site.selector'); + + $siteManager = $container->get('sonata.page.manager.site'); + $host = $request->getHost(); + $criteria = [ + 'locale' => $request->getLocale(), + 'host' => $host, + ]; + $site = $siteManager->findOneBy($criteria); + //$site = $siteSelector->retrieve(); + + if ($request->getLocale() !== $site->getLocale()) { + // Check if there's site for this locale + $siteManager = $container->get('sonata.page.manager.site'); + $host = $request->getHost(); + $criteria = [ + 'locale' => $request->getLocale(), + 'host' => $host, + ]; + $site = $siteManager->findOneBy($criteria); + if (!$site) { + // Create new site for this host and language + $site = $siteManager->create(); + $site->setHost($host); + $site->setEnabled(true); + $site->setName($host.' in language '.$request->getLocale()); + $site->setEnabledFrom(new \DateTime('now')); + $site->setEnabledTo(new \DateTime('+20 years')); + $site->setRelativePath(''); + $site->setIsDefault(false); + $site->setLocale($request->getLocale()); + $site = $siteManager->save($site); + + // Create first root page + + /** @var PageManager $pageManager */ + $pageManager = $container->get('sonata.page.manager.page'); + /** @var \Sonata\PageBundle\Model\Page $page */ + $page = $pageManager->create(); + $page->setSlug('homepage'); + $page->setUrl('/'); + $page->setName('homepage'); + $page->setTitle('home'); + $page->setEnabled(true); + $page->setDecorate(1); + $page->setRequestMethod('GET|POST|HEAD|DELETE|PUT'); + $page->setTemplateCode('default'); + $page->setRouteName('homepage'); + //$page->setParent($this->getReference('page-homepage')); + $page->setSite($site); + $pageManager->save($page); + } + } + $em = $this->getDoctrine()->getManager(); $page = null; @@ -77,8 +139,15 @@ class PageController extends BaseController $blockToEdit = null; if ($site) { $pageManager = $this->get('sonata.page.manager.page'); - // Parents only of homepage - $criteria = ['site' => $site, 'enabled' => true, 'parent' => 1, 'slug' => $pageSlug]; + + // Getting parent + $criteria = ['site' => $site, 'enabled' => true, 'parent' => null]; + /** @var Page $page */ + $parent = $pageManager->findOneBy($criteria); + + // Check if a page exists for this site + $criteria = ['site' => $site, 'enabled' => true, 'parent' => $parent, 'slug' => $pageSlug]; + /** @var Page $page */ $page = $pageManager->findOneBy($criteria); if ($page) { @@ -102,10 +171,6 @@ class PageController extends BaseController } else { $pageManager = $this->get('sonata.page.manager.page'); - $criteria = ['site' => $site, 'enabled' => true, 'parent' => null, 'slug' => 'homepage']; - /** @var Page $page */ - $parent = $pageManager->findOneBy($criteria); - $page = $pageManager->create(); $page->setSlug($pageSlug); $page->setUrl('/'.$pageSlug); @@ -191,14 +256,72 @@ class PageController extends BaseController return $this->redirectToRoute('home'); } - $template = $pageSlug.'_edit.html.twig'; - return $this->render( - '@ChamiloCore/Index/'.$template, + '@ChamiloCore/Index/page_edit.html.twig', [ 'page' => $page, 'form' => $form->createView(), ] ); } + + /** + * The Chamilo index home page. + * + * @Route("/internal_page/edit/{slug}", name="edit_page") + * @Method({"GET|POST"}) + * @Security("has_role('ROLE_ADMIN')") + * + * @param string $slug + * + * @return Response + */ + public function editPageAction($slug): Response + { + return $this->forward( + 'Chamilo\PageBundle\Controller\PageController:createPage', + ['pageSlug' => $slug, 'redirect' => $this->generateUrl('edit_page', ['slug' => $slug ])] + ); + } + + /** + * @Route("/internal_page/{slug}") + * + * @param string $slug + * @param Request $request + * + * @return Response + */ + public function renderPageAction(string $slug, Request $request): Response + { + /*$siteSelector = $this->get('sonata.page.site.selector'); + $site = $siteSelector->retrieve();*/ + + $container = $this->container; + $siteManager = $container->get('sonata.page.manager.site'); + $host = $request->getHost(); + $criteria = [ + 'locale' => $request->getLocale(), + 'host' => $host, + ]; + $site = $siteManager->findOneBy($criteria); + + $page = null; + if ($site) { + $pageManager = $this->get('sonata.page.manager.page'); + // Parents only of homepage + $criteria = ['site' => $site, 'enabled' => true, 'slug' => $slug]; + /** @var Page $page */ + $page = $pageManager->findOneBy($criteria); + } + + return $this->render( + '@ChamiloCore/Index/page.html.twig', + [ + 'page' => $page, + 'slug' => $slug, + 'content' => 'welcome', + ] + ); + } } diff --git a/src/ThemeBundle/Resources/views/Sidebar/login.html.twig b/src/ThemeBundle/Resources/views/Sidebar/login.html.twig index 3dc6524c2f..00e05ad147 100644 --- a/src/ThemeBundle/Resources/views/Sidebar/login.html.twig +++ b/src/ThemeBundle/Resources/views/Sidebar/login.html.twig @@ -1,23 +1,25 @@ -
- - -
+{{ locale_switcher(null, null, 'ChamiloCoreBundle:Admin:switcher_links.html.twig') }} + +{#
#} + {##} + {##} +{#
#}
diff --git a/src/UserBundle/Entity/User.php b/src/UserBundle/Entity/User.php index d4bb4046c4..82f7606510 100644 --- a/src/UserBundle/Entity/User.php +++ b/src/UserBundle/Entity/User.php @@ -1962,7 +1962,7 @@ class User extends BaseUser implements ThemeUser, EquatableInterface //implement /** * @return string */ - public function getPictureLegacy() : string + public function getPictureLegacy(): string { $id = $this->id;