Code for module weight does not work
Eliminate the square brackets from the query and it should work:

$weight = db_select('system', 's')
  -&gt;fields('s', array('weight'))
  -&gt;condition('name', 'commerce_checkout_redirect', '=')
  -&gt;execute()
  -&gt;fetchField();


// Set our module to a weight 1 heavier, so ours moves lower in execution order

 db_update('system')
    -&gt;fields(array('weight' =&gt; $weight + 1))
    -&gt;condition('name', 'redirect_after_login', '=')
    -&gt;execute();