From 2ace80bab957810933bd53c5ae90927dd29a9569 Mon Sep 17 00:00:00 2001 From: Joseph Madden Date: Wed, 28 Jun 2023 15:18:33 -0500 Subject: [PATCH 1/2] Update hasoneedit.yml config for SS5 and PHP8.2 Currently when set to After: framework/* we are getting an error whenever the MAILER_DSN environment variable is set. Updating this to just After: framework seems to resolve the issue. Error we were getting was the following - Fatal error: Uncaught MJS\TopSort\CircularDependencyException: Circular dependency found: modelascontrollercatchallroute->hasoneedit->mailer-dsn-env->hasoneedit in /vendor/marcj/topsort/src/CircularDependencyException.php:34 Stack trace: #0 /vendor/marcj/topsort/src/Implementations/BaseImplementation.php(57): MJS\TopSort\CircularDependencyException::create(Array) #1 /vendor/marcj/topsort/src/Implementations/ArraySort.php(63): MJS\TopSort\Implementations\BaseImplementation->throwCircularExceptionIfNeeded(Object(stdClass), Array) #2 /vendor/marcj/topsort/src/Implementations/ArraySort.php(75): MJS\TopSort\Implementations\ArraySort->visit(Object(stdClass), Array) #3 /vendor/marcj/topsort/src/Implementations/ArraySort.php(75): MJS\TopSort\Implementations\ArraySort->visit(Object(stdClass), Array) #4 /vendor/marcj/topsort/src/Implementations/ArraySort.php(75): MJS\TopSort\Implementations\ArraySort->visit(Object(stdClass), Array) #5 /vendor/marcj/topsort/src/Implementations/ArraySort.php(115): MJS\TopSort\Implementations\ArraySort->visit(Object(stdClass), Array) #6 /vendor/marcj/topsort/src/Implementations/ArraySort.php(98): MJS\TopSort\Implementations\ArraySort->doSort() #7 /vendor/silverstripe/config/src/Transformer/YamlTransformer.php(517): MJS\TopSort\Implementations\ArraySort->sort() #8 /vendor/silverstripe/config/src/Transformer/YamlTransformer.php(104): SilverStripe\Config\Transformer\YamlTransformer->getSortedYamlDocuments() #9 /vendor/silverstripe/config/src/Collections/MemoryConfigCollection.php(73): SilverStripe\Config\Transformer\YamlTransformer->transform(Object(SilverStripe\Config\Collections\MemoryConfigCollection)) #10 /vendor/silverstripe/framework/src/Core/Config/CoreConfigFactory.php(89): SilverStripe\Config\Collections\MemoryConfigCollection->transform(Array) #11 /vendor/silverstripe/framework/src/Core/Config/CoreConfigFactory.php(67): SilverStripe\Core\Config\CoreConfigFactory->createCore() #12 [internal function]: SilverStripe\Core\Config\CoreConfigFactory->SilverStripe\Core\Config\{closure}() #13 /vendor/silverstripe/config/src/Collections/CachedConfigCollection.php(139): call_user_func(Object(Closure)) #14 /vendor/silverstripe/config/src/Collections/CachedConfigCollection.php(88): SilverStripe\Config\Collections\CachedConfigCollection->getCollection() #15 /vendor/silverstripe/framework/src/Core/Config/Config_ForClass.php(81): SilverStripe\Config\Collections\CachedConfigCollection->get('SilverStripe\\Co...', 'module_priority', 1) #16 /vendor/silverstripe/framework/src/Core/Config/Config_ForClass.php(114): SilverStripe\Core\Config\Config_ForClass->get('module_priority', 1) #17 /vendor/silverstripe/framework/src/Core/Manifest/ModuleManifest.php(232): SilverStripe\Core\Config\Config_ForClass->uninherited('module_priority') #18 /vendor/silverstripe/framework/src/Core/BaseKernel.php(200): SilverStripe\Core\Manifest\ModuleManifest->sort() #19 /vendor/silverstripe/framework/src/Core/CoreKernel.php(32): SilverStripe\Core\BaseKernel->bootManifests(true) #20 /vendor/silverstripe/framework/src/Control/HTTPApplication.php(132): SilverStripe\Core\CoreKernel->boot(true) #21 /vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php(65): SilverStripe\Control\HTTPApplication->SilverStripe\Control\{closure}(Object(SilverStripe\Control\HTTPRequest)) #22 /vendor/silverstripe/framework/src/Control/HTTPApplication.php(130): SilverStripe\Control\HTTPApplication->callMiddleware(Object(SilverStripe\Control\HTTPRequest), Object(Closure)) #23 /vendor/silverstripe/framework/src/Control/HTTPApplication.php(113): SilverStripe\Control\HTTPApplication->execute(Object(SilverStripe\Control\HTTPRequest), Object(Closure), true) #24 /public/index.php(25): SilverStripe\Control\HTTPApplication->handle(Object(SilverStripe\Control\HTTPRequest)) #25 {main} thrown in /vendor/marcj/topsort/src/CircularDependencyException.php on line 34 --- _config/hasoneedit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_config/hasoneedit.yml b/_config/hasoneedit.yml index fa3f540..aef17fc 100644 --- a/_config/hasoneedit.yml +++ b/_config/hasoneedit.yml @@ -1,6 +1,6 @@ --- Name: hasoneedit -After: framework/* +After: framework --- SilverStripe\CMS\Controllers\CMSMain: extensions: From 1b91d7bce5eb2a98e6b243bd45e042064e2cfda7 Mon Sep 17 00:00:00 2001 From: Joseph Madden Date: Wed, 28 Jun 2023 15:26:46 -0500 Subject: [PATCH 2/2] Update hasoneedit.yml Fixing error when trying to just use After:framework --- _config/hasoneedit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_config/hasoneedit.yml b/_config/hasoneedit.yml index aef17fc..12a0b03 100644 --- a/_config/hasoneedit.yml +++ b/_config/hasoneedit.yml @@ -1,6 +1,6 @@ --- Name: hasoneedit -After: framework +After: '#coreextensions' --- SilverStripe\CMS\Controllers\CMSMain: extensions: