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

Error : Setting up an Admin Backend - isInternational #1

Open
Lainocs opened this issue Apr 26, 2024 · 2 comments
Open

Error : Setting up an Admin Backend - isInternational #1

Lainocs opened this issue Apr 26, 2024 · 2 comments

Comments

@Lainocs
Copy link

Lainocs commented Apr 26, 2024

Hello,
I was reading the fast track, and discovered what I think is an error.
In chapter Setting up an Admin Backend, after implementing the __toString method, I tried to create a Conference but was met with the following message :

The method "isInternational" in class "App\Entity\Conference" requires 0 arguments, but should accept only 1..

I made sure to follow each previous step thoroughly, so unless something slipped past me, there may be an error somewhere.
I have not found a solution yet, but I'll make sure to share it here if I do.

Cheers 😄

@Lainocs
Copy link
Author

Lainocs commented Apr 26, 2024

I tried adding 2 methods getTest and setTest in my Conference entity like so:

public function setTest(bool $test)
{
    $this->isInternational = $test;
    return $this;
}

public function getTest(): ?bool
{
    return $this->isInternational;
}

And I set the boolean field in my CRUD to use these test methods:

BooleanField::new('test'),

And it works now!
I think the problem might be coming from the property being called isInternational but I am fairly inexperienced with Symfony and I afraid I wouldn't know how to fix it.
Hope this will help anyways 🏃🏼

@Lisstem
Copy link

Lisstem commented May 1, 2024

I have encountered the same problem.
Renaming isInternational() to getIsInternational() and setInternational() to setIsInternational() for Conference did solve it.
This is just a dirty quick fix and i hope someone can provide a proper solution.

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

No branches or pull requests

2 participants