bin/console sonata:page:create-site \
--name='test' \
--host='test.local' \
--relativePath=/ \
--enabled=true \
--enabledFrom=- --enabledTo=- \
--default=true \
--locale='en'
...
Site created !
You can now create the related pages and snapshots by running the followings commands:
php app/console sonata:page:update-core-routes --site=1
php app/console sonata:page:create-snapshots --site=1
next step FAILs
bin/console sonata:page:update-core-routes --site=all
================================================
> Updating core routes for site : test - //test.local
================================================
In Page.php line 311:
Type error: trim() expects parameter 1 to be string, null given
in dev.log
php.INFO: User Deprecated: The Knp\Bundle\MenuBundle\EventListener\VoterInitializerListener class is deprecated since 2.2 and will be removed in 3.0. {"exception":"[object] (ErrorException(code: 0): User Deprecated: The Knp\\Bundle\\MenuBundle\\EventListener\\VoterInitializerListener class is deprecated since 2.2 and will be removed in 3.0. at /opt/evals/symfony4/vendor/knplabs/knp-menu-bundle/src/EventListener/VoterInitializerListener.php:5)"} []
php.INFO: User Deprecated: The Sonata\CacheBundle\Invalidation\SimpleCacheInvalidation class is deprecated since version 2.4 and will be removed in 3.0. Use Sonata\Cache\Invalidation\SimpleCacheInvalidation instead. {"exception":"[object] (ErrorException(code: 0): User Deprecated: The Sonata\\CacheBundle\\Invalidation\\SimpleCacheInvalidation class is deprecated since version 2.4 and will be removed in 3.0. Use Sonata\\Cache\\Invalidation\\SimpleCacheInvalidation instead. at /opt/evals/symfony4/vendor/sonata-project/cache-bundle/src/Invalidation/SimpleCacheInvalidation.php:17)"} []
doctrine.DEBUG: SELECT t0.enabled AS enabled_1, t0.name AS name_2, t0.relative_path AS relative_path_3, t0.host AS host_4, t0.enabled_from AS enabled_from_5, t0.enabled_to AS enabled_to_6, t0.is_default AS is_default_7, t0.created_at AS created_at_8, t0.updated_at AS updated_at_9, t0.locale AS locale_10, t0.title AS title_11, t0.meta_keywords AS meta_keywords_12, t0.meta_description AS meta_description_13, t0.id AS id_14 FROM page__site t0 [] []
doctrine.DEBUG: SELECT t0.route_name AS route_name_1, t0.page_alias AS page_alias_2, t0.type AS type_3, t0.position AS position_4, t0.enabled AS enabled_5, t0.decorate AS decorate_6, t0.edited AS edited_7, t0.name AS name_8, t0.slug AS slug_9, t0.url AS url_10, t0.custom_url AS custom_url_11, t0.request_method AS request_method_12, t0.title AS title_13, t0.meta_keyword AS meta_keyword_14, t0.meta_description AS meta_description_15, t0.javascript AS javascript_16, t0.stylesheet AS stylesheet_17, t0.raw_headers AS raw_headers_18, t0.template AS template_19, t0.created_at AS created_at_20, t0.updated_at AS updated_at_21, t0.id AS id_22, t0.site_id AS site_id_23, t0.parent_id AS parent_id_24, t0.target_id AS target_id_25 FROM page__page t0 WHERE t0.url = ? AND t0.site_id = ? LIMIT 1 ["/",1] []
php.INFO: User Deprecated: The "Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait::render()" method is considered final since version 3.4. It may change without further notice as of its next major version. You should not extend it from "Sonata\MediaBundle\Controller\MediaAdminController". {"exception":"[object] (ErrorException(code: 0): User Deprecated: The \"Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerTrait::render()\" method is considered final since version 3.4. It may change without further notice as of its next major version. You should not extend it from \"Sonata\\MediaBundle\\Controller\\MediaAdminController\". at /opt/evals/symfony4/vendor/symfony/debug/DebugClassLoader.php:256)"} []
php.INFO: User Deprecated: The "Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait::render()" method is considered final since version 3.4. It may change without further notice as of its next major version. You should not extend it from "Sonata\MediaBundle\Controller\GalleryAdminController". {"exception":"[object] (ErrorException(code: 0): User Deprecated: The \"Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerTrait::render()\" method is considered final since version 3.4. It may change without further notice as of its next major version. You should not extend it from \"Sonata\\MediaBundle\\Controller\\GalleryAdminController\". at /opt/evals/symfony4/vendor/symfony/debug/DebugClassLoader.php:256)"} []
doctrine.DEBUG: SELECT t0.route_name AS route_name_1, t0.page_alias AS page_alias_2, t0.type AS type_3, t0.position AS position_4, t0.enabled AS enabled_5, t0.decorate AS decorate_6, t0.edited AS edited_7, t0.name AS name_8, t0.slug AS slug_9, t0.url AS url_10, t0.custom_url AS custom_url_11, t0.request_method AS request_method_12, t0.title AS title_13, t0.meta_keyword AS meta_keyword_14, t0.meta_description AS meta_description_15, t0.javascript AS javascript_16, t0.stylesheet AS stylesheet_17, t0.raw_headers AS raw_headers_18, t0.template AS template_19, t0.created_at AS created_at_20, t0.updated_at AS updated_at_21, t0.id AS id_22, t0.site_id AS site_id_23, t0.parent_id AS parent_id_24, t0.target_id AS target_id_25 FROM page__page t0 WHERE t0.route_name = ? AND t0.site_id = ? LIMIT 1 ["fos_js_routing_js",1] []
console.ERROR: Error thrown while running command "sonata:page:update-core-routes --site=all". Message: "trim() expects parameter 1 to be string, null given" {"error":"[object] (TypeError(code: 0): trim() expects parameter 1 to be string, null given at /opt/evals/symfony4/vendor/sonata-project/page-bundle/src/Model/Page.php:311)","command":"sonata:page:update-core-routes --site=all","message":"trim() expects parameter 1 to be string, null given"} []
console.DEBUG: Command "sonata:page:update-core-routes --site=all" exited with code "1" {"command":"sonata:page:update-core-routes --site=all","code":1} []
php.CRITICAL: Type error: trim() expects parameter 1 to be string, null given {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Type error: trim() expects parameter 1 to be string, null given at /opt/evals/symfony4/vendor/sonata-project/page-bundle/src/Model/Page.php:311)"} []
this trim error appears in a number of online references
here's one
For a Symfony4 install
create DBs
init
create admin user
create site
next step FAILs
in dev.log
this trim error appears in a number of online references here's one
code change is a condition string wrapper around trim https://github.com/yireo/Yireo_CheckoutTester2/pull/7/files#diff-735f70c1f948ebbd90915b1548d93432