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

Unable to save default site that do not have own base URL #3632

Closed
martinleveille opened this issue Jan 15, 2019 · 1 comment
Closed

Unable to save default site that do not have own base URL #3632

martinleveille opened this issue Jan 15, 2019 · 1 comment

Comments

@martinleveille
Copy link

Description

Unable to save default site that do not have own base URL.

Steps to reproduce

  1. Create a new project with composer create-project craftcms/craft craft-test.
  2. Modify the composer.json with "craftcms/cms": "^3.1.0-beta.1".
  3. Run composer update to get the Craft 3.1.0-beta.7 vendor.
  4. Run php craft setup to install Craft normally.
  5. Login to the /admin control panel.
  6. Edit the default site /admin/settings/sites/1
  7. Uncheck the This site has its own base URL checkbox.
  8. Click the save button.

Stack trace

An Error occurred while handling another error:
TypeError: Return value of craft\models\Site::getBaseUrl() must be of the type string, null returned in /Volumes/Data/Martin/Sites/craft-test/vendor/craftcms/cms/src/models/Site.php:105
Stack trace:
#0 /Volumes/Data/Martin/Sites/craft-test/vendor/craftcms/cms/src/helpers/UrlHelper.php(333): craft\models\Site->getBaseUrl()
#1 /Volumes/Data/Martin/Sites/craft-test/vendor/craftcms/cms/src/helpers/UrlHelper.php(514): craft\helpers\UrlHelper::baseSiteUrl()
#2 /Volumes/Data/Martin/Sites/craft-test/vendor/craftcms/cms/src/helpers/UrlHelper.php(229): craft\helpers\UrlHelper::_createUrl('', '', NULL, false)
#3 /Volumes/Data/Martin/Sites/craft-test/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(237): craft\helpers\UrlHelper::siteUrl()
#4 /Volumes/Data/Martin/Sites/craft-test/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(91): craft\web\assets\cp\CpAsset->_craftData()
#5 /Volumes/Data/Martin/Sites/craft-test/vendor/yiisoft/yii2/web/View.php(266): craft\web\assets\cp\CpAsset->registerAssetFiles(Object(craft\web\View))
#6 /Volumes/Data/Martin/Sites/craft-test/vendor/craftcms/cms/src/web/View.php(1482): yii\web\View->registerAssetFiles('craft\\web\\asset...')
#7 /Volumes/Data/Martin/Sites/craft-test/vendor/yiisoft/yii2/web/View.php(264): craft\web\View->registerAssetFiles('craft\\web\\asset...')
#8 /Volumes/Data/Martin/Sites/craft-test/vendor/craftcms/cms/src/web/View.php(1482): yii\web\View->registerAssetFiles('craft\\web\\asset...')
#9 /Volumes/Data/Martin/Sites/craft-test/vendor/yiisoft/yii2/web/View.php(162): craft\web\View->registerAssetFiles('craft\\web\\asset...')
#10 /Volumes/Data/Martin/Sites/craft-test/vendor/craftcms/cms/src/web/View.php(876): yii\web\View->endBody()
#11 /Volumes/Data/Martin/Sites/craft-test/vendor/yiisoft/yii2/views/errorHandler/exception.php(526): craft\web\View->endBody()
#12 /Volumes/Data/Martin/Sites/craft-test/vendor/yiisoft/yii2/base/View.php(336): require('/Volumes/Data/M...')
#13 /Volumes/Data/Martin/Sites/craft-test/vendor/yiisoft/yii2/base/View.php(254): yii\base\View->renderPhpFile('/Volumes/Data/M...', Array)
#14 /Volumes/Data/Martin/Sites/craft-test/vendor/yiisoft/yii2/web/ErrorHandler.php(266): yii\base\View->renderFile('/Volumes/Data/M...', Array, Object(craft\web\ErrorHandler))
#15 /Volumes/Data/Martin/Sites/craft-test/vendor/yiisoft/yii2/web/ErrorHandler.php(126): yii\web\ErrorHandler->renderFile('@yii/views/erro...', Array)
#16 /Volumes/Data/Martin/Sites/craft-test/vendor/craftcms/cms/src/web/ErrorHandler.php(132): yii\web\ErrorHandler->renderException(Object(TypeError))
#17 /Volumes/Data/Martin/Sites/craft-test/vendor/yiisoft/yii2/base/ErrorHandler.php(111): craft\web\ErrorHandler->renderException(Object(TypeError))
#18 /Volumes/Data/Martin/Sites/craft-test/vendor/craftcms/cms/src/web/ErrorHandler.php(63): yii\base\ErrorHandler->handleException(Object(TypeError))
#19 [internal function]: craft\web\ErrorHandler->handleException(Object(TypeError))
#20 {main}

Additional info

  • Craft version: Craft 3.1-beta.7
  • PHP version: 7.2.14
  • Database driver & version: MySQL 5.7.24
  • Plugins & versions: No
@brandonkelly
Copy link
Member

Duplicate of #3624

@brandonkelly brandonkelly marked this as a duplicate of #3624 Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants