1
0
mirror of https://github.com/flarum/core.git synced 2025-09-04 05:25:37 +02:00

Compare commits

..

16 Commits

Author SHA1 Message Date
Franz Liedke
bbe62f400f Release version 0.1.0-beta.8.1 2018-12-06 00:47:38 +01:00
Franz Liedke
fc5977f86f Do not create tables as InnoDB automatically, rely on connection default
As argued in #1675, this makes us slightly less reliant on MySQL.
2018-12-06 00:34:43 +01:00
Toby Zerner
796b57753d Don't output empty html tag attributes
From https://discuss.flarum.org/d/17817-meta-description-is-empty/8
ref #1677
2018-12-04 09:47:49 +10:30
Toby Zerner
88e43cc694 Fix empty meta description tag. Fixes #1677 2018-12-04 09:28:24 +10:30
Toby Zerner
6370f7ecff Set the default engine in the installer
The installer doesn't use DatabaseServiceProvider, so we need to set
the default engine in the config here too.

Fixes #1675
2018-12-04 09:12:19 +10:30
Toby Zerner
d9d7027ed0 Fix oopsie in fb6b51b1cf 2018-12-04 08:54:33 +10:30
flarum-bot
1106a2e3a3 Bundled output for commit b7f666525c [skip ci] 2018-12-02 22:26:12 +00:00
Toby Zerner
b7f666525c Update changelog 2018-12-03 08:51:27 +10:30
Toby Zerner
40dc6ac604 Fix discussion list scroll position not being maintained when hero is not visible 2018-12-03 08:50:54 +10:30
Toby Zerner
15e1a154e5 Add changelog 2018-12-02 08:08:44 +10:30
Franz Liedke
57d5846b64 Migrations: Fix dropping foreign keys
Passing an array to dropForeign does not mean dropping multiple indices,
but rather dropping a key on multiple tables.

Passing a string means that this string will be interpreted as index
name, not as name of the indexed column. Passing an array with one
string is therefore correct, in order to benefit from automatic index
name generation.
2018-11-30 14:02:37 +01:00
Franz Liedke
fb6b51b1cf Set InnoDB for DB connection and new tables
Refs #1661.
2018-11-29 23:21:58 +01:00
Franz Liedke
57f73c9638 Installer: Fix invalid join time of admin user
Fixes #1664.
2018-11-29 22:56:56 +01:00
Franz Liedke
7705a2b7d7 Fix search with database prefix
wrap() only adds a table prefix when referencing a column with a table
name (such as `foo.bar`) - when only a single identifier is provided, it
is assumed to be a column name, which does not need a prefix.

Fixes #1659.
2018-11-29 22:50:32 +01:00
Franz Liedke
f591585d02 Fix live output in ResetCommand
This was forgotten in 9e487b4.

Fixes #1663.
2018-11-29 22:04:01 +01:00
Franz Liedke
45afc33eb0 Fix code style and doc block 2018-11-29 21:31:12 +01:00
17 changed files with 58 additions and 36 deletions

13
CHANGELOG.md Normal file
View File

@@ -0,0 +1,13 @@
# Changelog
## [0.1.0-beta.8.1](https://github.com/flarum/core/compare/v0.1.0-beta.8...v0.1.0-beta.8.1)
### Fixed
- Fix live output in `migrate:reset` command ([f591585](https://github.com/flarum/core/commit/f591585d02f8c4ff0211c5bf4413dd6baa724c05))
- Fix search with database prefix ([7705a2b](https://github.com/flarum/core/commit/7705a2b7d751943ef9d0c7379ec34f8530b99310))
- Fix invalid join time of admin user created by installer ([57f73c9](https://github.com/flarum/core/commit/57f73c9638eeb825f9e336ed3c443afccfd8995e))
- Ensure InnoDB engine is used for all tables ([fb6b51b](https://github.com/flarum/core/commit/fb6b51b1cfef0af399607fe038603c8240800b2b))
- Fix dropping foreign keys in `down` migrations ([57d5846](https://github.com/flarum/core/commit/57d5846b647881009d9e60f9ffca20b1bb77776e))
- Fix discussion list scroll position not being maintained when hero is not visible ([40dc6ac](https://github.com/flarum/core/commit/40dc6ac604c2a0973356b38217aa8d09352daae5))
- Fix empty meta description tag ([88e43cc](https://github.com/flarum/core/commit/88e43cc6940ee30d6529e9ce659471ec4fb1c474))
- Remove empty attributes on `<html>` tag ([796b577](https://github.com/flarum/core/commit/796b57753d34d4ea741dbebcbc550b17808f6c94))

2
js/dist/forum.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -102,7 +102,7 @@ export default class IndexPage extends Page {
// previous hero. Maintain the same scroll position relative to the bottom
// of the hero so that the sidebar doesn't jump around.
const oldHeroHeight = app.cache.heroHeight;
const heroHeight = app.cache.heroHeight = this.$('.Hero').outerHeight();
const heroHeight = app.cache.heroHeight = this.$('.Hero').outerHeight() || 0;
const scrollTop = app.cache.scrollTop;
$('#app').css('min-height', $(window).height() + heroHeight);

View File

@@ -47,10 +47,11 @@ return [
'down' => function (Builder $schema) {
$schema->table('discussions', function (Blueprint $table) use ($schema) {
$table->dropForeign([
'user_id', 'last_posted_user_id', 'hidden_user_id',
'first_post_id', 'last_post_id'
]);
$table->dropForeign(['user_id']);
$table->dropForeign(['last_posted_user_id']);
$table->dropForeign(['hidden_user_id']);
$table->dropForeign(['first_post_id']);
$table->dropForeign(['last_post_id']);
Migration::fixIndexNames($schema, $table);
});

View File

@@ -37,7 +37,8 @@ return [
'down' => function (Builder $schema) {
$schema->table('discussion_user', function (Blueprint $table) use ($schema) {
$table->dropForeign(['user_id', 'discussion_id']);
$table->dropForeign(['user_id']);
$table->dropForeign(['discussion_id']);
Migration::fixIndexNames($schema, $table);
});

View File

@@ -37,7 +37,8 @@ return [
'down' => function (Builder $schema) {
$schema->table('group_user', function (Blueprint $table) use ($schema) {
$table->dropForeign(['user_id', 'group_id']);
$table->dropForeign(['user_id']);
$table->dropForeign(['group_id']);
Migration::fixIndexNames($schema, $table);
});

View File

@@ -41,7 +41,8 @@ return [
'down' => function (Builder $schema) {
$schema->table('notifications', function (Blueprint $table) use ($schema) {
$table->dropForeign(['user_id', 'from_user_id']);
$table->dropForeign(['user_id']);
$table->dropForeign(['from_user_id']);
Migration::fixIndexNames($schema, $table);
});

View File

@@ -43,10 +43,10 @@ return [
'down' => function (Builder $schema) {
$schema->table('posts', function (Blueprint $table) use ($schema) {
$table->dropForeign([
'user_id', 'discussion_id',
'edited_user_id', 'hidden_user_id'
]);
$table->dropForeign(['user_id']);
$table->dropForeign(['discussion_id']);
$table->dropForeign(['edited_user_id']);
$table->dropForeign(['hidden_user_id']);
Migration::fixIndexNames($schema, $table);
});

View File

@@ -71,11 +71,8 @@ class ResetCommand extends AbstractCommand
$this->info('Rolling back extension: '.$extensionName);
$notes = $this->manager->migrateDown($extension);
foreach ($notes as $note) {
$this->info($note);
}
$this->manager->getMigrator()->setOutput($this->output);
$this->manager->migrateDown($extension);
$this->info('DONE.');
}

View File

@@ -25,7 +25,9 @@ class DatabaseServiceProvider extends AbstractServiceProvider
$this->app->singleton('flarum.db', function () {
$factory = new ConnectionFactory($this->app);
$connection = $factory->make($this->app->config('database'));
$dbConfig = $this->app->config('database');
$dbConfig['engine'] = 'InnoDB';
$connection = $factory->make($dbConfig);
$connection->setEventDispatcher($this->app->make('Illuminate\Contracts\Events\Dispatcher'));
return $connection;

View File

@@ -53,7 +53,7 @@ class FulltextGambit implements GambitInterface
$query
->addSelect('posts_ft.most_relevant_post_id')
->join(
new Expression('('.$subquery->toSql().') '.$grammar->wrap('posts_ft')),
new Expression('('.$subquery->toSql().') '.$grammar->wrapTable('posts_ft')),
'posts_ft.discussion_id', '=', 'discussions.id'
)
->addBinding($subquery->getBindings(), 'join')

View File

@@ -223,22 +223,24 @@ class ExtensionManager
*
* @param Extension $extension
* @param bool|true $up
* @return array Notes from the migrator.
* @return void
*/
public function migrate(Extension $extension, $up = true)
{
if ($extension->hasMigrations()) {
$migrationDir = $extension->getPath().'/migrations';
if (! $extension->hasMigrations()) {
return;
}
$this->app->bind('Illuminate\Database\Schema\Builder', function ($container) {
return $container->make('Illuminate\Database\ConnectionInterface')->getSchemaBuilder();
});
$migrationDir = $extension->getPath().'/migrations';
if ($up) {
$this->migrator->run($migrationDir, $extension);
} else {
$this->migrator->reset($migrationDir, $extension);
}
$this->app->bind('Illuminate\Database\Schema\Builder', function ($container) {
return $container->make('Illuminate\Database\ConnectionInterface')->getSchemaBuilder();
});
if ($up) {
$this->migrator->run($migrationDir, $extension);
} else {
$this->migrator->reset($migrationDir, $extension);
}
}

View File

@@ -25,7 +25,7 @@ class Application extends Container implements ApplicationContract
*
* @var string
*/
const VERSION = '0.1.0-beta.8';
const VERSION = '0.1.0-beta.8.1';
/**
* The base path for the Flarum installation.

View File

@@ -28,7 +28,7 @@ class Meta
$meta = [
'viewport' => 'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1',
'description' => array_get($forumApiDocument, 'data.attributes.forumDescription'),
'description' => array_get($forumApiDocument, 'data.attributes.description'),
'theme-color' => array_get($forumApiDocument, 'data.attributes.themePrimaryColor')
];

View File

@@ -11,6 +11,7 @@
namespace Flarum\Install\Console;
use Carbon\Carbon;
use Exception;
use Flarum\Console\AbstractCommand;
use Flarum\Database\DatabaseMigrationRepository;
@@ -238,6 +239,8 @@ class InstallCommand extends AbstractCommand
$factory = new ConnectionFactory($this->application);
$laravelDbConfig['engine'] = 'InnoDB';
$this->db = $factory->make($laravelDbConfig);
$version = $this->db->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
@@ -294,7 +297,7 @@ class InstallCommand extends AbstractCommand
'username' => $admin['username'],
'email' => $admin['email'],
'password' => (new BcryptHasher)->make($admin['password']),
'joined_at' => time(),
'joined_at' => Carbon::now(),
'is_email_confirmed' => 1,
]);

View File

@@ -1,5 +1,6 @@
<!doctype html>
<html dir="{{ $direction }}" lang="{{ $language }}">
<html @if ($direction) dir="{{ $direction }}" @endif
@if ($language) lang="{{ $language }}" @endif>
<head>
<meta charset="utf-8">
<title>{{ $title }}</title>