Skip to content

Commit

Permalink
Merge pull request #6616 from GawainLynch/hotfix/extension-visibility
Browse files Browse the repository at this point in the history
[3.2] Fix incompatible extensions showing
  • Loading branch information
bobdenotter committed May 4, 2017
2 parents b0db84a + 9d83b42 commit 5f245ad
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
9 changes: 5 additions & 4 deletions app/config/config.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ theme: base-2016
# locales, ensure the first is a standard locale.
locale: en_GB

# Set the timezone to be used on the website. For a list of valid timezone
# Set the timezone to be used on the website. For a list of valid timezone
# settings, see: http://php.net/manual/en/timezones.php
# timezone: UTC

Expand Down Expand Up @@ -407,10 +407,11 @@ hash_strength: 10
# prefer-stable: true # Prefer stable releases over development ones
# prefer-dist: true # Forces installation from package dist even for dev versions.
# prefer-source: false # Forces installation from package sources when possible, including VCS information.
# optimize-autoloader: false # Optimize autoloader during autoloader dump.
# classmap-authoritative: false # Autoload classes from the classmap only. Implicitly enables `optimize-autoloader`.
# options:
# optimize-autoloader: false # Optimize autoloader during autoloader dump.
# classmap-authoritative: false # Autoload classes from the classmap only. Implicitly enables `optimize-autoloader`.

# Enforcing the use of SSL. If set, all pages will enforce an SSL connection,
# Enforcing the use of SSL. If set, all pages will enforce an SSL connection,
# and redirect to HTTPS if you attempt to visit plain HTTP pages.
# enforce_ssl: true

Expand Down
2 changes: 1 addition & 1 deletion app/src/js/modules/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@
$.ajax({
url: bolt.data('extend.siteurl') + 'list.json',
dataType: 'jsonp',
data: {'name': searchVal}
data: {'name': searchVal, 'bolt': bolt.data('extend.sitever')}
})
.success(function (data) {
if (data.packages.length) {
Expand Down
1 change: 1 addition & 0 deletions app/view/twig/extend/extend.twig
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
{{ data('extend.text.updating', __('page.extend.message.updating')) }}
{{ data('extend.text.updated', __('page.extend.message.updated')) }}

{{ data('extend.sitever', context.extendVersion) }}
{{ data('extend.siteurl', context.site) }}
{{ data('extend.baseurl', app['resources'].url('bolt') ~ 'extend'|trim('/') ~ '/') }}
{{ data('extend.rootpath', paths.rootpath) }}
Expand Down
23 changes: 14 additions & 9 deletions src/Composer/JsonManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,23 @@ public function update()
*/
private function setJsonDefaults(array $json)
{
$rootPath = $this->app['resources']->getPath('root');
$extensionsPath = $this->app['resources']->getPath('extensions');
$srcPath = $this->app['resources']->getPath('src');
$webPath = $this->app['resources']->getPath('web');
$resources = $this->app['resources'];
$config = $this->app['config'];

$rootPath = $resources->getPath('root');
$extensionsPath = $resources->getPath('extensions');
$srcPath = $resources->getPath('src');
$webPath = $resources->getPath('web');
$pathToRoot = Path::makeRelative($rootPath, $extensionsPath);
$pathToWeb = Path::makeRelative($webPath, $extensionsPath);
$eventPath = Path::makeRelative($srcPath . '/Composer/EventListener', $extensionsPath);
/** @deprecated Handle BC on 'stability' key until 4.0 */
$minimumStability = $this->app['config']->get('general/extensions/stability') ?: $this->app['config']->get('general/extensions/composer/minimum-stability', 'stable');
$minimumStability = $config->get('general/extensions/stability') ?: $config->get('general/extensions/composer/minimum-stability', 'stable');

$config = $config->get('general/extensions/composer/options', []) + [
'discard-changes' => true,
'preferred-install' => 'dist',
];

// Enforce standard settings
$defaults = [
Expand All @@ -125,10 +133,7 @@ private function setJsonDefaults(array $json)
],
'minimum-stability' => $minimumStability,
'prefer-stable' => true,
'config' => [
'discard-changes' => true,
'preferred-install' => 'dist',
],
'config' => $config,
'provide' => [
'bolt/bolt' => Bolt\Version::forComposer(),
],
Expand Down
1 change: 1 addition & 0 deletions src/Controller/Backend/Extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ private function getRenderContext()
'online' => $this->app['extend.online'],
'extensionsPath' => $extensionsPath,
'site' => $this->app['extend.site'],
'extendVersion' => Bolt\Version::forComposer(),
];
}

Expand Down

0 comments on commit 5f245ad

Please sign in to comment.