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.
Hi,
I hope to help.
A variable by the name " composer_autoload_path " is created when we submit the config form ("admin/config/development/composer_autoload"). The " composer_autoload_path " variable is not deleted on uninstalling the module.
Proposed Solution:-
1. Add a file named " composer_autoload.install "
2. Implement hook_uninstall() {} and delete the variable within it.
function composer_autoload_uninstall(){
variable_del('composer_autoload_path');
}
Comment | File | Size | Author |
---|---|---|---|
#4 | 2842591-add_hook_uninstall_variable_del.patch | 401 bytes | vishwac9 |
#2 | add_hook_uninstall_variable_del.patch | 428 bytes | vishwac9 |
Comments
Comment #2
vishwac9 CreditAttribution: vishwac9 as a volunteer and at InfoBeans Technologies Limited commentedPlease find the patch
Comment #3
darrenwh CreditAttribution: darrenwh as a volunteer and at Investis Digital commentedFile missing new line at end of file
Indentation needs to be 2 spaces
Comment #4
vishwac9 CreditAttribution: vishwac9 as a volunteer and at InfoBeans Technologies Limited commentedThanks @darrenwh for pointing out the mistake, please find the updated patch
Comment #5
priyanka.attarde CreditAttribution: priyanka.attarde as a volunteer and at InfoBeans Technologies Limited commentedPatch works well.
Comment #6
SwapS CreditAttribution: SwapS as a volunteer commented@vishwac9
Variable will get created in DB only when user saves configuration form for the module is submitted.
Just simple install & uninstall will result sql failure as Variable doesn't exist in DB.
Suggestion : Add install hook with default value
Cheers
SwapS
Comment #7
vishwac9 CreditAttribution: vishwac9 as a volunteer and at InfoBeans Technologies Limited commented@Swaps,
Thanks for the input, but i do not think so that would be a case. You can check for the variable_del document . It runs a db_delete query which checks for a condition by variable name, nor even the result of db_delete is checked. Even tried to install and quickly uninstall the module, havent seen any sql errors. If you do not have any other input please update the issue to RTBC, updated patches are surely welcomed :) .
Comment #8
vishwac9 CreditAttribution: vishwac9 as a volunteer and at InfoBeans Technologies Limited commentedComment #9
SwapS CreditAttribution: SwapS as a volunteer commented@vishwac you are right there. Patch @ #4 worked well.
Cheers,
SwapS
Comment #10
apaderno