Hi,

due to a number of unresolved issues I'd like to uninstall 'JavaScript Aggregator'. For that I disabled the module and went to ./admin/build/modules/uninstall which gives me an WSOD. Nothing is logged in watchdog log, and the module is not being uninstalled.

From Apache's error.log:

[Sun Dec 04 13:10:49 2011] [error] [client 12.34.56.78] PHP Fatal error:  Exception thrown without a stack frame in Unknown on line 0
[Sun Dec 04 13:53:46 2011] [error] [client 12.34.56.78] PHP Fatal error:  Cannot redeclare phptemplate_closure() (previously declared in /var/www/drupal/sites/all/modules/advagg/advagg.module:158) in /var/www/drupal/sites/all/modules/javascript_aggregator/javascript_aggregator.module on line 93, referer: http://mysite.org/admin/build/modules/uninstall/confirm

Woraround: The AdvAgg submodules 'AdvAgg Bundler', 'AdvAgg Compress CSS', 'AdvAgg Compress Javascript', 'Advanced CSS/JS Aggregation' need to be disabled to be able to uninstall 'JavaScript Aggregator'.

Comments

mikeytown2’s picture

Issue is in Javascript Aggregator as it blindly creates the function without checking first.
http://drupalcode.org/project/javascript_aggregator.git/blob/refs/heads/...

/**
 * Implementation of theme_closure().
 *
 * Minify the aggregated JavaScript file in the page footer if JavaScript
 * Optimization is turned on.
 */
function phptemplate_closure($main = 0) {
...

AdvAgg checks first
http://drupalcode.org/project/advagg.git/blob/3253017a22f2e00c5921234150...

if (variable_get('advagg_closure', ADVAGG_CLOSURE)) {
  if (!function_exists('phptemplate_closure')) {
...

AdvAgg will also disable the closure if the javascript_aggregator module exists.
http://drupalcode.org/project/advagg.git/blob/3253017a22f2e00c5921234150...

  if (module_exists('javascript_aggregator')) {
    variable_set('advagg_closure', FALSE);
  }

So the question for asb is how did you get into this odd state on your box?

asb’s picture

Component: Code » Documentation
Priority: Major » Normal

My procedure was to disable Javascript Aggregator, then install and enable the mentioned sub-modules from AdvAgg. After that I tried to uninstall Javascript Aggregator with the given result.

The correct procedure would be: (1) disable Javascript Aggregator, (2) uninstall Javascript Aggregator and it's files, (3) install, and enable AdvAgg and sub-modules.

From the user point of view, this is a documentation issue that should go into README.TXT.

Why did I not uninstall the "old" module immediately? Users like me often try an alternative module to see (a) if it works at all, (b) if it works as advertised. If you have some experience with contributed Drupal modules, you might experience all kinds of desaster, so you might prefer to leave a partially working module as backup in case the alternative module actually causes disaster. If the alternative candidate proves worthy (AdvAgg did that for me on the testing site), you uninstall and delete the "old" module. This is a common "workflow" because we users assume, that "disabling" a module actually keeps it temporarily out of the system, like switching a TV set off if it becomes distracting. Similar like such a turned off TV set, Drupal modules sometimes are not completely disconnected from the "system" (power grid, or whatever), unless they are completely unplugged (= uninstalled). A common misconception, so a README.TXT should educate us about it ;)