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

[4.x]: 4.11.0 Config TypeError #15481

Closed
chadcrowell opened this issue Aug 6, 2024 · 6 comments
Closed

[4.x]: 4.11.0 Config TypeError #15481

chadcrowell opened this issue Aug 6, 2024 · 6 comments

Comments

@chadcrowell
Copy link

chadcrowell commented Aug 6, 2024

What happened?

Description

Updated from 4.10.x to 4.11.0 and getting this error, on local DDEV install. Appears to be related to this commit
eb47a44

Actual behavior

TypeError: craft\services\Config::_createConfigObj(): Argument #3 ($existingConfig) must be of type ?craft\config\BaseConfig, stdClass given, called in /var/www/html/vendor/craftcms/cms/src/services/Config.php on line 107 and defined in /var/www/html/vendor/craftcms/cms/src/services/Config.php:116
Stack trace:
#0 /var/www/html/vendor/craftcms/cms/src/services/Config.php(107): craft\services\Config->_createConfigObj('custom', 'custom.web', Object(stdClass))
#1 /var/www/html/vendor/craftcms/cms/src/services/Config.php(200): craft\services\Config->getConfigSettings('custom')
#2 /var/www/html/vendor/enupal/stripe/src/services/Settings.php(140): craft\services\Config->getCustom()
#3 /var/www/html/vendor/enupal/stripe/src/services/Settings.php(59): enupal\stripe\services\Settings->getConfigSettings()
#4 /var/www/html/vendor/enupal/stripe/src/services/Settings.php(111): enupal\stripe\services\Settings->getSettings()
#5 /var/www/html/vendor/enupal/stripe/src/services/Settings.php(123): enupal\stripe\services\Settings->getPrivateKey()
#6 /var/www/html/vendor/enupal/stripe/src/services/Subscriptions.php(35): enupal\stripe\services\Settings->initializeStripe()
#7 /var/www/html/vendor/enupal/stripe/src/services/Subscriptions.php(70): enupal\stripe\services\Subscriptions->getStripeSubscription('sub_1MLzcmKm2U7...')
#8 /var/www/html/vendor/enupal/stripe/src/elements/Order.php(781): enupal\stripe\services\Subscriptions->getSubscriptionModel('sub_1MLzcmKm2U7...')
#9 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(1635): enupal\stripe\elements\Order->getSubscription()
#10 /var/www/html/vendor/craftcms/cms/src/helpers/Template.php(148): twig_get_attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(enupal\stripe\elements\Order), 'getSubscription', Array, 'method', false, false, false, 37)
#11 /var/www/html/storage/runtime/compiled_templates/b5/b56a6f4b281fcb1980d85b56930ec5a0.php(100): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(enupal\stripe\elements\Order), 'getSubscription', Array, 'method', false, false, false, 37)
#12 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_46567b2dc2d09dab53924d456bb09773->doDisplay(Array, Array)
#13 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#14 /var/www/html/storage/runtime/compiled_templates/bf/bf24a22526c77ecff11350bc2964eae0.php(51): Twig\Template->display(Array, Array)
#15 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_cdc02229351dca8c89f4329ce8ed4106->doDisplay(Array, Array)
#16 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#17 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\Template->display(Array)
#18 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\Template->render(Array)
#19 /var/www/html/vendor/twig/twig/src/Environment.php(280): Twig\TemplateWrapper->render(Array)
#20 /var/www/html/vendor/craftcms/cms/src/web/View.php(495): Twig\Environment->render('index.twig', Array)
#21 /var/www/html/vendor/craftcms/cms/src/web/View.php(548): craft\web\View->renderTemplate('index.twig', Array)
#22 /var/www/html/vendor/craftcms/cms/src/web/TemplateResponseFormatter.php(57): craft\web\View->renderPageTemplate('index.twig', Array, 'site')
#23 /var/www/html/vendor/yiisoft/yii2/web/Response.php(1109): craft\web\TemplateResponseFormatter->format(Object(craft\web\Response))
#24 /var/www/html/vendor/craftcms/cms/src/web/Response.php(338): yii\web\Response->prepare()
#25 /var/www/html/vendor/yiisoft/yii2/web/Response.php(340): craft\web\Response->prepare()
#26 /var/www/html/vendor/yiisoft/yii2/base/Application.php(390): yii\web\Response->send()
#27 /var/www/html/public/index.php(12): yii\base\Application->run()
#28 {main}

Craft CMS version

4.11.0

PHP version

8.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@chadcrowell chadcrowell changed the title [4.x]: [4.x]: 4.11.0 Config TypeError Aug 6, 2024
@BigglesZX
Copy link

BigglesZX commented Aug 6, 2024

FWIW getting this same error in 5.3, CP is fine but the front-end throws this error on every template.

@mofman
Copy link

mofman commented Aug 6, 2024

Not quite sure if this is related but getting this error in 4.11.0 when applying yaml now:

/usr/bin/php8.1 craft project-config/apply
Applying changes from your project config files ...
- updating entryTypes.9bfd335a-0ebd-43e5-a20b-ce138205e9e2.fieldLayouts.5675097d-d652-4638-aa28-ee0758f3ff7d.tabs.0 ...
  - updating entryTypes.9bfd335a-0ebd-43e5-a20b-ce138205e9e2 ...
error: Calling unknown method: craft\console\Request::getQueryParam()

@jamescutts
Copy link

jamescutts commented Aug 6, 2024

we've hit the same issue with a number of sites, we have a custom.php following the documentation.

This looks to have been caused by #15346

Specifically this section of code https://github.com/craftcms/cms/pull/15346/files#diff-b129318b3fde4cc9f2ac57c9a504d0e1129aebb64ac5936d814c67e3d3c3f3efR104

It looks like a null check is required on "$category.$this->appType" as this seems to be the cause of the issue, the change is assuming there is a appType which hasnt been set on custom.php and there has been no breaking change communicated of such.

as a work around we have reverted this method back to almost the prior version and the site then works.

    {
        if (!isset($this->_configSettings[$category])) {
            $this->_configSettings[$category] = $this->_createConfigObj($category, $category, null);
        }

        return $this->_configSettings[$category];
    }

@juddlyon
Copy link

juddlyon commented Aug 6, 2024

Same issue here - I'm using a custom.php. @jamescutts patch works for now but hoping for a speedy official fix as it breaks the front-end of the site.

@jamescutts
Copy link

jamescutts commented Aug 6, 2024

The same issue also should also apply to craft 5, we've seen the same issue affecting that too. Thankfully its possible to roll back v4 to the prior version if needed.

@brandonkelly
Copy link
Member

Thanks for reporting this! Just tagged 4.11.0.1 and 5.3.0.1 with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants