mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
chore: handle deprecations from 1.x (#3909)
* chore: drop deprecated `post_number_index` column * chore: remove deprecated `FlagsWillBeDeleted` event * chore: `Migration::addSettings` can still be needed * chore: `settings->get` default can still be needed * chore: deprecated `$default` in `Settings::serializeToForum` extender * chore: deprecated request `actor` attribute * chore: already handled * chore: remove `RecompileFrontendAssets::whenSettingsSaved` * chore: remove `getReadIds` * chore: `Model::dateAttribute` extender * chore: `evented` js util * chore: `WelcomeHero` js hidden prop * chore: attributes pushData with relations * chore: app request options `extract` * chore: itemlist deprecations * chore: `search` state * chore: `getMentionText` * chore: deprecated non-registered store type * chore: `Button` title * chore: `Modal` deprecations * chore * chore: deprecated `less` mixins * Apply fixes from StyleCI * fix * fix: phpstan * fix * fix --------- Co-authored-by: StyleCI Bot <bot@styleci.io>
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
padding: 15px 15px;
|
||||
|
||||
.scrolled & {
|
||||
.box-shadow(0 2px 6px var(--shadow-color));
|
||||
box-shadow: 0 2px 6px var(--shadow-color);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -54,7 +54,7 @@ export default function () {
|
||||
|
||||
const controls = PostControls.destructiveControls(this.attrs.post);
|
||||
|
||||
Object.keys(controls.items).forEach((k) => {
|
||||
Object.keys(controls.toObject()).forEach((k) => {
|
||||
const attrs = controls.get(k).attrs;
|
||||
|
||||
attrs.className = 'Button';
|
||||
|
@@ -10,7 +10,6 @@
|
||||
namespace Flarum\Flags\Command;
|
||||
|
||||
use Flarum\Flags\Event\Deleting;
|
||||
use Flarum\Flags\Event\FlagsWillBeDeleted;
|
||||
use Flarum\Post\Post;
|
||||
use Flarum\Post\PostRepository;
|
||||
use Illuminate\Events\Dispatcher;
|
||||
@@ -31,9 +30,6 @@ class DeleteFlagsHandler
|
||||
|
||||
$actor->assertCan('viewFlags', $post->discussion);
|
||||
|
||||
// Deprecated, removed v2.0
|
||||
$this->events->dispatch(new FlagsWillBeDeleted($post, $actor, $command->data));
|
||||
|
||||
foreach ($post->flags as $flag) {
|
||||
$this->events->dispatch(new Deleting($flag, $actor, $command->data));
|
||||
}
|
||||
|
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* For detailed copyright and license information, please view the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Flags\Event;
|
||||
|
||||
use Flarum\Post\Post;
|
||||
use Flarum\User\User;
|
||||
|
||||
/**
|
||||
* @deprecated v2.0
|
||||
* Listen for Flarum\Flags\Event\Deleting instead
|
||||
*/
|
||||
class FlagsWillBeDeleted
|
||||
{
|
||||
public function __construct(
|
||||
public Post $post,
|
||||
public User $actor,
|
||||
public array $data = []
|
||||
) {
|
||||
}
|
||||
}
|
@@ -5,7 +5,6 @@ import './components/UserMentionedNotification';
|
||||
import './fragments/AutocompleteDropdown';
|
||||
import './fragments/PostQuoteButton';
|
||||
import './utils/getCleanDisplayName';
|
||||
import './utils/getMentionText';
|
||||
import './utils/reply';
|
||||
import './utils/selectedText';
|
||||
import './utils/textFormatter';
|
||||
|
@@ -1,21 +0,0 @@
|
||||
import app from 'flarum/forum/app';
|
||||
|
||||
/**
|
||||
* Fetches the mention text for a specified user (and optionally a post ID for replies or group).
|
||||
*
|
||||
* Automatically determines which mention syntax to be used based on the option in the
|
||||
* admin dashboard. Also performs display name clean-up automatically.
|
||||
*
|
||||
* @deprecated Use `app.mentionables.get('user').replacement(user)` instead. Will be removed in 2.0.
|
||||
*/
|
||||
export default function getMentionText(user, postId, group) {
|
||||
if (user !== undefined && postId === undefined) {
|
||||
return app.mentionables.get('user').replacement(user);
|
||||
} else if (user !== undefined && postId !== undefined) {
|
||||
return app.mentionables.get('post').replacement(app.store.getById('posts', postId));
|
||||
} else if (group !== undefined) {
|
||||
return app.mentionables.get('group').replacement(group);
|
||||
}
|
||||
|
||||
throw 'No parameters were passed';
|
||||
}
|
@@ -44,7 +44,8 @@ return [
|
||||
->default('flarum-nicknames.set_on_registration', true)
|
||||
->default('flarum-nicknames.min', 1)
|
||||
->default('flarum-nicknames.max', 150)
|
||||
->serializeToForum('displayNameDriver', 'display_name_driver', null, 'username')
|
||||
->default('display_name_driver', 'username')
|
||||
->serializeToForum('displayNameDriver', 'display_name_driver')
|
||||
->serializeToForum('setNicknameOnRegistration', 'flarum-nicknames.set_on_registration', 'boolval')
|
||||
->serializeToForum('randomizeUsernameOnRegistration', 'flarum-nicknames.random_username', 'boolval'),
|
||||
|
||||
|
Reference in New Issue
Block a user