Commit Graph

50 Commits

Author SHA1 Message Date
Sami Mazouz
6f11e044a7
chore: update codebase to php8.1 (#3827)
* chore: set minimum php version to 8.1

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: update codebase to php8.1

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* chore: update workflow php version

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: caught errors

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: more caught errors

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: phpstan caught errors

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* fix: test-caught errors

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: test-caught errors

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: test-caught errors

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: introduce `Flarum\Locale\TranslatorInterface`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* chore: remove mixin

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: test-caught errors

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: one last error

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-05-30 11:36:12 +01:00
Sami Mazouz
9363682e1c
fix: filter values are not validated (#3795) 2023-05-07 18:37:53 +01:00
Sami Mazouz
da1bf8da21
chore(phpstan): enable phpstan in bundled extensions (#3667)
* feat(phpstan): pick up extended model relations typings
* feat(phpstan): pick up extended model date attributes
* feat(core): introduce `castAttribute` extender
Stops using `dates` as it's deprecated in laravel 8
* feat(phpstan): pick up extended model attributes through casts
* fix: extenders not resolved when declared namespace
* fix(phpstan): new model attributes are always nullable
* chore(phpstan): add helpful cache clearing command
* Apply fixes from StyleCI
* chore: improve extend files provider logic
* chore: rename `castAttribute` to just `cast`
* chore: update phpstan package to detect `cast` method
* chore: enable phpstan in bundled extensions
* chore: rebasing conflicts
* chore: rebasing conflicts
* chore: typings for latest 1.7 changes

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-01-19 21:49:38 +01:00
Alexander Skvortsov
258fe6d158 Apply fixes from StyleCI 2021-04-12 02:29:32 +00:00
Alexander Skvortsov
078441204d Use criteria's sortIsDefault field
This was introduced in https://github.com/flarum/core/pull/2773, and allows us to more cleanly determine whether the sort requested is the default one, while taking extension modifications into account.
2021-04-11 22:29:20 -04:00
Alexander Skvortsov
b14d24964f Apply fixes from StyleCI 2021-03-13 21:01:56 +00:00
SychO9
72ad775840 Update to beta.16 2021-03-13 16:00:50 -05:00
Alexander Skvortsov
2712afc81e Make listener methods static
This is needed since we're listening to the individual methods of the class, as opposed to registering the class as a subscriber.
2020-12-10 23:34:54 -05:00
Alexander Skvortsov
c7837f801e Use event extender where possible
filter extender will eliminate the last callback-style extender before stable.
2020-12-08 12:34:32 -05:00
Sami Mazouz
01549123c0 Use new extenders (#22) 2020-12-08 11:53:05 -05:00
Matt Kilgore
38c0e3c500 Removes AssertPermissionTrait (#17)
* Removes AssertPermissionTrait

* Fix my dumb mistake
2020-07-20 07:59:16 +02:00
Franz Liedke
e9f298bf89 Apply fixes from StyleCI 2019-11-29 23:02:29 +00:00
Toby Zerner
c4692d2bcd Database changes (#11)
* Update core references

* Update remaining core references
2018-09-16 20:50:31 +02:00
Franz Liedke
6b67263f01 Ensure compatibility with DB table prefix 2018-08-03 01:24:17 +02:00
Franz Liedke
a4c42dcfff Adapt new bootstrap format, use Asset extender 2018-01-16 23:19:29 +01:00
Toby Zerner
cf0ae80691 Remove use of event priorities
Event priorities are no longer in Laravel - see dbbfc62bef
2018-01-11 14:22:43 +10:30
Toby Zerner
8bfaff339e Only pin to top if viewing a tag with no other filters 2018-01-11 12:28:35 +10:30
Toby Zerner
57c730af29 Merge branch 'master' into next-back
# Conflicts:
#	src/Listener/PinStickiedDiscussionsToTop.php
2017-12-26 20:38:55 +10:30
Toby Zerner
20f6a256d5 Only touch orders property if we're going to add to it 2017-11-13 13:18:36 +10:30
Toby Zerner
c7d7b2d360 Fix subsequent pages of results not working properly 2017-11-13 09:17:55 +10:30
Toby Zerner
0ce00c6d16 Performance: Refactor SQL that pins unread sticky posts to the top
Ordering by `is_sticky and (unread subquery) desc` removes MySQL's
ability to use an index for ordering by `last_time`, which triggers a
filesort across the whole discussions table which is BAD.

This commit uses a union to add all stickied discussions to the query.
The results of the unioned queries are then ordered by the `is_sticky
and (unread subquery)` criteria, so the filesort only takes place on
a maximum of limit * 2 rows. Big performance win when you get up to
thousands of discussions!
2017-11-12 21:28:17 +10:30
Toby Zerner
7ff57e1ba4 Refactor sticky order clause into a subquery
Based on some limited testing, using a subquery seems to outperform a
join in this case (the join was invoking a temporary table, which is
always a bad sign).

This also adds logic to fix a bug where sticky discussions would remain
at the top even when marked as read using the "mark all as read" button.
I thought we had an open issue for this somewhere, but I can't seem to
find one. ref #988 #1003
2017-11-08 11:34:37 +10:30
Franz Liedke
b28f116b06 Fix class names 2017-10-03 19:45:54 +02:00
Franz Liedke
a8c43097d7 Update namespaces for beta 8
Refs flarum/core#1235.
2017-10-01 19:55:07 +02:00
Toby Zerner
7564533d1d Apply fixes from StyleCI
[ci skip] [skip ci]
2016-11-29 05:29:44 +00:00
Toby Zerner
dce149b536 Use new event name 2016-06-03 11:02:34 +09:30
Toby Zerner
3b6fc53f91 Update MergeableInterface method arguments 2016-02-29 18:54:25 +10:30
Toby Zerner
b59268b856 Applied fixes from StyleCI 2016-02-25 22:56:55 -05:00
Toby Zerner
395b45156b Translations are now automatically included 2015-11-02 18:52:52 +10:30
Toby Zerner
030e0c9938 Update API, add default translations 2015-10-11 22:24:12 +10:30
Toby Zerner
37d7874705 Update for composer branch
Also remove sticky notification
2015-10-11 11:43:13 +10:30
Toby Zerner
0d7a7682be Add sticky permission to grid 2015-09-22 18:05:40 +09:30
Toby Zerner
3ab62fb0ca Add LICENSE information 2015-09-04 12:30:25 +09:30
Franz Liedke
a90dfd686a Make sure query filter works with database prefix, too
Related to flarum/core#269.
2015-08-29 23:02:00 +02:00
Toby Zerner
8531580f06 Use new listen API 2015-08-13 12:50:59 +09:30
Toby Zerner
14b8ed7236 PERF: avoid reinstantiation of event subscribers 2015-07-27 11:54:35 +09:30
Toby Zerner
97ef05de20 Fix notification error 2015-07-23 16:40:41 +09:30
Toby Zerner
115551c9ce Group assets by client 2015-07-22 10:14:20 +09:30
Toby Zerner
1ad057d4d7 Update for evented API 2015-07-20 18:14:42 +09:30
Toby Zerner
27ed9ab636 Update gambit for search API 2015-06-26 12:21:47 +09:30
Toby Zerner
039606e325 Bring back sticky discussion excerpts 2015-06-25 09:58:35 +09:30
Toby Zerner
835c3eef71 Fix compatibility with tags extension 2015-06-25 09:58:11 +09:30
Toby Zerner
0892a979be Update APIs 2015-06-18 12:45:44 +09:30
Toby Zerner
194de6be37 Fix error when there are no orders on the query 2015-06-03 18:05:23 +09:30
Toby Zerner
ba31890aa4 Update for new notifications API 2015-05-20 12:32:17 +09:30
Toby Zerner
2be7c4affc Rename ActivityPost to EventPost 2015-05-18 18:47:55 +09:30
Toby Zerner
bd1d165355 Update for new extension API 2015-05-17 10:20:26 +09:30
Toby Zerner
30d546383e Add sticky permission 2015-05-15 17:06:50 +09:30
Toby Zerner
798bdd3e68 Update notification architecture 2015-05-14 22:42:52 +09:30
Toby Zerner
3787cc413e Initial commit 2015-05-07 22:26:02 +09:30