Open thomasisok opened 6 years ago
I just discovered that it only happens when I don't pass the class name as part of the make:crud
command, but add it at the The class name of the entity to create CRUD
prompt. If I just do php bin/console make:crud Sample
, it works as I expected.
@thomasisok maybe there is a problem with autocomplete? I'll try to reproduce your env to test.
@thomasisok yea, it is possible that when you're typing Sample
, the console command is auto-completing this to SampleClassification
. Can you double-check that and make sure that only Sample
is entered? This is one of the cases when the auto-completion can be annoying.
Hello,
I don't know if this is the correct place for requesting... but I would like to know follow:
How can I generate a crud in a custom bundle? The old syntax doesn't work, ie: bin/console make:crud MyCustomBundle:MyCustomEntity
thank you!
@weaverryan Yes, I've experimented with it a bit and I'm certain I'm only entering Sample
. If I enter php bin/console make:crud
and then enter Sample
at the following prompt, it apparently autocompletes it to SampleClassification
, but if I give the class in the initial command php bin/console make:crud Sample
it doesn't. I don't know if this is intended behavior or not, and it isn't really that much of a problem now that I know how to avoid it. Is there any more info I need to give here? This is my first time reporting anything so I'm not sure.
Hmmm. Thanks for the info. Maybe, could you take a screenshot of when you answer the question interactively with “Sample” (like: right befor you hit Enter to answer the question)?
@cronk1986 you can enter the full class name in most cases. So, when you’re asked the question, try typing \My\CustomBundle\Entity\Foo
If your entity name starts with a slash, we assume you are pointing to an exact entity. To pass this as an argument, all the slashes will need to be double slashes.
This is because of how Symfony autocomplete works. If you have SampleClassification
and type Sample
+ <Enter>
... Symfony understands the <Enter>
as "yes, autocomplete this to SampleClassification" instead of "yes, I've written Sample and that's what I want to use":
The only working solution I can come up is to add a whitespace after Sample
and press <Enter>
:
@javiereguiluz maybe there is a way to sort autocomplete values by length to evade this situation? I'll try to investigate this situation.
@javiereguiluz Oh, that's interesting. I don't see the autocomplete happening like that. Is that because I'm on Windows? It would have been a lot more obvious what was happening to begin with if I had seen it autocompleting.
@thomasisok by the way I'm on windows too, and I don't have this problem.
@sadikoff You can see it autocompleting as you type like in that gif? I'm on Windows 7, and don't see the autocomplete, either in cmd or powershell.
No I don't have autocomplete, but when I type Sample
it works with Sample
entity!
For example, I used
make:crud
to generate a controller for my entitySampleClassification
. Then I created another entitySample
, but when I tried tomake:crud
forSample
I got this error: