There's a disconnect between how the module looks for the "wget" command in hook_requirements and how it is configured via the settings page that leads to the module not working.

wget_static_requirements() uses the "which wget" command to identify where the command is. On many servers (and Macs that are using Homebrew) the wget command is not in a default system path, it's installed somewhere else. It does not check the "wget_static_command" variable, so if the settings page had been updated to the correct path it never recognizes this fact. It also sets the "wget_static_cmd_availability" variable to FALSE if the "which wget" command fails, but never allows it to be set to TRUE when the command is set correctly.

The admin page checks the "wget_static_cmd_availability" variable that is set during hook_requirements() and displays a field to edit the command if the variable is FALSE. However, if the form is saved and the correct path is assigned the variable is never updated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna created an issue. See original summary.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
3.42 KB

This fixes hook_requirements so that it uses the variable (with the "-h" argument) to confirm if the command is available. It then also updates the "wget_static_cmd_availability " variable correctly if the "wget" command works. Lastly, it updates the variable on the config page if the command is available, and always makes the field available so that the path may be modified.

Status: Needs review » Needs work

The last submitted patch, 2: wget_static-n2796561-2.patch, failed testing.

DamienMcKenna’s picture

Status: Needs work » Needs review

The testbot fails because the module doesn't have any tests.

bisonbleu’s picture

Status: Needs review » Reviewed & tested by the community

Many thanks @DamienMcKenna, and great module !

More than 2 years later but the patch applied cleanly and I was able to export an old D7 to static pages from localhost on a MacBook Pro :)

Minor Notices in the dblog:

  • Notice: Undefined index: settings in panels_renderer_standard->render_pane() (line 572 of /Applications/MAMP/htdocs/my_site/sites/all/modules/contrib/panels/plugins/display_renderers/panels_renderer_standard.class.php).
  • The file /tmp/wget was not deleted, because it does not exist.