Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The module list call back is not working properly
- It doesn't filter the module list based on the entry
- If you put your module within a folder (i.e. : custom) the module name doesn't shows up, custom is
Patch is coming
Comment | File | Size | Author |
---|---|---|---|
#8 | generator_ui-changing_autocomplete_route-2473763-8.patch | 2.21 KB | Kgaut |
Comments
Comment #1
Kgaut CreditAttribution: Kgaut commentedComment #2
eme CreditAttribution: eme commentedWell, this is much better indeed, but we need :
- To have an autocompetion on non active module because we'll for sure create a module and some files, and the activate it.
- To exclude core module (we do not want to mess up with the core).
- If possible, change $_GET['q'] into an argument of the function like we did in Drupal 7.
Comment #3
eme CreditAttribution: eme commentedFor core, it is quite easy as we can see the folder structure with core/xx
But for disabled module, it may be harsher and we may need to find the right method to parse de module folder and find all files to get the .info.yml.
Comment #4
Kgaut CreditAttribution: Kgaut commentedYep,
Will dig it.
but for this point :
It can't find a way to achieve that , there is a #autocomplete_route_parameters but it doesn't seem to apply to our case : https://www.drupal.org/node/2070985
Do you know how to configure the field to tell the way to use the autocomplete argument ?
Comment #5
Kgaut CreditAttribution: Kgaut commentedHere's the patch returning only non core module, but only the activated. I'll look for a way to add non-activated too.
Comment #6
Kgaut CreditAttribution: Kgaut commentedJust found a way with the function system_rebuild_module_data().
Patched attached fixing ;
Comment #7
eme CreditAttribution: eme commentedThat is a great job !
I think that we should keep contributed modules in the list. We could query the drupal.org API to know for it, but I will for sure develop some contributed module with generator UI.
Last thing is to avoid the $_GET parameters and we can achieve that with the Request object.
So we need to
use Symfony\Component\HttpFoundation\Request
and then we can get the query part by simply addingRequest $request
as argument in the autocomplete method and then calling$request->query->get('q');
And just after, we'll create an autocomplete generator !
Comment #8
Kgaut CreditAttribution: Kgaut commentedHere's the version using the HTTPFoundation component