Skip to content

Commit

Permalink
Legacy installable shim: run updates per-site when not network active
Browse files Browse the repository at this point in the history
When an extension was not network active, the old installables class
would still run the updates for all sites at once. However, in the new
installables app this was fixed for the new installable objects. We
still weren't handling it properly in our shim for legacy entities still
using the un/installer API though, so we've updated it to pass in the
`$network` parameter correctly for extensions.

See #706, #404
  • Loading branch information
JDGrimes committed Aug 15, 2017
1 parent 5a6df39 commit f4f18bc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/classes/installable/legacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,19 @@ public function get_update_routines() {
$db_version = $this->get_db_version();

if ( $db_version && version_compare( $this->version, $db_version, '>' ) ) {

$network = null;

if ( 'module' === $this->type && is_multisite() ) {
$network = is_wordpoints_module_active_for_network(
wordpoints_module_basename(
WordPoints_Modules::get_data( $this->slug, 'raw_file' )
)
);
}

$installer = WordPoints_Installables::get_installer( $this->type, $this->slug );
$installer->update( $db_version, $this->version );
$installer->update( $db_version, $this->version, $network );
}

return parent::get_update_routines();
Expand Down

0 comments on commit f4f18bc

Please sign in to comment.