Skip to content

fix: get controllers fqcn for route load #6883

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

Open
wants to merge 2 commits into
base: 4.x
Choose a base branch
from

Conversation

IndraGunawan
Copy link
Contributor

@IndraGunawan IndraGunawan commented Mar 27, 2025

fixes #6509

current behaviour: injecting tagged_iterator to AdminRouteGenerator while it only needs the controller class fqcn, make it initialize all the controllers (#6509 (comment))

example controller

class BookCrudController extends AbstractCrudController
{
    public function __construct(
        #[Autowire(env: 'NOT_EXISTS')]
        private string $notExistsEnv,
    ) {
    }

    public static function getEntityFqcn(): string
    {
        return Book::class;
    }

    public function configureFields(string $pageName): iterable
    {
        return [
            TextField::new('title'),
            BooleanField::new('isPublished'),
        ];
    }
}

proposed solution: use CompilerPass to get all class fqcn

@IndraGunawan IndraGunawan force-pushed the fix-controller-initialization branch from 840f9c4 to 52063b2 Compare March 27, 2025 06:25
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

Successfully merging this pull request may close these issues.

Pretty URL Router fails to clear cache if ENV var only exists in PROD
1 participant