Cms: [3.5.0-RC3] Infinite loop in \craft\services\Sites::_allSites

Created on 28 Jul 2020  路  1Comment  路  Source: craftcms/cms

Description

After upgrading one of our sites to try out Craft 3.5.0-RC3, we are experiencing an infinite loop in the web-bootstrap. This occurs in both the site and CP and caused by the way the current site is determined.

Steps to reproduce

  1. We always use our custom multi-site logic to set a site handle in the CRAFT_SITE constant of the web/index.php.
  2. Thus, \craft\services\Sites::setCurrentSite() uses the getSiteByHandle().
  3. However, \craft\services\Sites::_allSites() calls Craft::$app->getRequest()->getIsCpRequest(), which also uses the \craft\services\Sites and causes an infinite loop.

Commenting out getIsCpRequest() at r.1254 of \craft\services\Sites prevents this issue and points out this bug. While this may be affected by the way we load our custom multi-site logic, this bug is introduced in 3.5. Is this an improvement in the Craft code to be made or is there a new route how we should would our desired site?

Additional info

  • Craft version: 3.5.0-RC3
  • PHP version: 7.2.24
  • Database driver & version: MySQL 5.5.65
  • Plugins & versions: _none_
bug normal

Most helpful comment

Thanks for reporting that! We just released Craft 3.5 RC4 with a fix.

>All comments

Thanks for reporting that! We just released Craft 3.5 RC4 with a fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davist11 picture davist11  路  3Comments

mccombs picture mccombs  路  3Comments

darylknight picture darylknight  路  3Comments

bitboxfw picture bitboxfw  路  3Comments

angrybrad picture angrybrad  路  3Comments