Commit Graph

37777 Commits

Author SHA1 Message Date
6358e79f0f FIX: catch NoMethodError during precompile_css too (#9940)
Ran into this on heroku:

    NoMethodError: undefined method `enabled?' for #<Theme:0x0000558f069e7718>
    vendor/bundle/ruby/2.6.0/gems/activemodel-6.0.1/lib/active_model/attribute_methods.rb:431:in `method_missing'
    app/models/theme.rb:155:in `block (2 levels) in transform_ids'
    vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.1/lib/active_record/relation/delegation.rb:85:in `each'
    vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.1/lib/active_record/relation/delegation.rb:85:in `each'
    vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.1/lib/active_record/relation/query_methods.rb:260:in `select'
    vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.1/lib/active_record/relation/query_methods.rb:260:in `select'
    app/models/theme.rb:155:in `block in transform_ids'
    app/models/theme.rb:105:in `get_set_cache'
    app/models/theme.rb:140:in `transform_ids'
    app/models/theme.rb:321:in `list_baked_fields'
    app/models/theme.rb:317:in `resolve_baked_field'
    lib/stylesheet/manager.rb:289:in `theme_digest'
2020-06-02 15:18:03 +10:00
111e8dec10 DEV: Bump rubocop from 0.84.0 to 0.85.0 (#9960)
Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 0.84.0 to 0.85.0.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop/compare/v0.84.0...v0.85.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

Change looks safe, everything is still passing lint
2020-06-02 15:11:33 +10:00
426b62a04a DEV: Add silencer for verbose query logs in development. 2020-06-02 12:15:31 +08:00
3dd1778199 PERF: Reduce number of queries from 3 -> 1 when fetching web manifest. 2020-06-02 12:04:02 +08:00
e4cd4f7e0b DEV: Avoid reaching for Redis#_client which is considered deprecated. 2020-06-02 11:46:55 +08:00
fe9c82994d DEV: Actually disconnect from Redis connections after fork. 2020-06-02 11:40:16 +08:00
ade60b0cbc DEV: Enable readonly mode for all multisite sites when PG goes down.
The risk here is that the database for one site goes down in the multisite setup and we drop everything to readonly mode. However, I discussed this with Sam and we agree that one database having problem is very rare. Most of the time, it is the entire DB cluster that goes down.
2020-06-02 11:32:07 +08:00
7897010dfd Fix lint. 2020-06-02 10:45:18 +08:00
370cba451d DEV: Refactor away conditionals that we don't need. 2020-06-02 10:40:29 +08:00
c21e3bbd1b DEV: Prefer create! over create when not checking return value.
We don't want stuff to silently fail.
2020-06-02 10:34:05 +08:00
2a0a689442 UX: prevent devices from miscalculating fullscreen composer height
Fixes issue seen in some Chromebooks that flip between tablet and regular notebook window size
2020-06-01 22:24:16 -04:00
7e52106812 DEV: when synchornizing state pull tags
In some cases we may want topic tracking state to keep track of tags
this small change ensures we do not remove them if they are already in place
2020-06-02 11:42:00 +10:00
326d6d5b0f DEV: Pause Sidekiq when forcing pg readonly mode. 2020-06-02 09:20:03 +08:00
fa6aa7f627 FIX: Digest frequency issue on user creation
If `default email digest frequency` was set to "Never", users would get
a `digest_after_minutes` set to `nil` which triggered this error
in the logs if/when the site eventually changed that setting and
enabled digests:

```
NoMethodError (undefined method `>=' for nil:NilClass)
/var/www/discourse/app/mailers/user_notifications.rb:227:in `digest'
```
2020-06-01 17:39:16 -04:00
a95826f60c Remove discourse constants (#9958)
* DEV: `Discourse.baseUri` does not exist

This never could have worked - should have been `Discourse.BaseUri` if
anything.

* DEV: Remove Discourse.Environment

* DEV: Remove `Discourse.disableMissingIconWarning`

* DEV: A bunch more missing environment checks
2020-06-01 16:33:43 -04:00
9162cd8f3d FIX: Only render group card if user title is from group (#9946)
This was failing when a user with a primary_group chose to display a title coming from a badge.
2020-06-01 11:44:41 -07:00
09dc5eb5ea Version bump to v2.5.0.beta6 v2.5.0.beta6 2020-06-01 14:13:48 -04:00
72c09ab4ae Update translations 2020-06-01 13:58:51 -04:00
b6709f0dda DEV: Add option to only show icons to header widget (#9935) 2020-06-01 12:26:59 -05:00
3106f85983 FIX: Support exporting reports which reference topics (#9957) 2020-06-01 18:23:58 +01:00
7b9d207175 DEV: Restore default_list_filter column migration
This migration was added to master temporarily, then removed. This resulted in some sites being in an inconsistent state. Adding the migration back for now. If we decide the column is unneeded, then we should add a second migration to remove the column.

This reverts part of commit e1af91f5aeaf5d19837544adab416b6ae3559e0f.
2020-06-01 18:16:00 +01:00
0d6b638dac FEATURE: New plugin outlet under badges page title (#9936) 2020-06-01 08:55:51 -07:00
c01a994263 DEV: Better error handling for destroy:users task (#9939) 2020-06-01 08:55:08 -07:00
13d00eaad0 Drop support for outdated browsers (#9956)
In particular, this includes Internet Explorer 11. Code which existed to support old browsers will be removed over the coming weeks.

https://meta.discourse.org/t/discourse-is-ending-support-for-internet-explorer-11-ie11-on-june-1-2020/137984
2020-06-01 16:38:44 +01:00
e19d907f0f FIX: Correct the misalignment of popover arrows (#9947)
* Fixes position of the top arrow, and border width of both
* Merged top and transform properties
* .5px values are required to make arrow border appear the same with as overall popover border width

I did have a chance to try it out on a Windows machine with a non-high DPI display and there were no issues. And I just re-tested it with Firefox on macOS using the "Open in Low Resolution" option and it looked more or less ok (bearing in mind that it the whole app is then a blurry mess, and that using custom zoom levels causes the arrow to break slightly, but that was also the case on Firefox before this change)
2020-06-01 16:31:53 +02:00
d8b258b4e5 Build(deps): Bump ffi from 1.12.2 to 1.13.0 (#9954)
Bumps [ffi](https://github.com/ffi/ffi) from 1.12.2 to 1.13.0.
- [Release notes](https://github.com/ffi/ffi/releases)
- [Changelog](https://github.com/ffi/ffi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ffi/ffi/compare/1.12.2...1.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-01 10:29:34 -04:00
2c43c21abc Build(deps): Bump coderay from 1.1.2 to 1.1.3 (#9943)
Bumps [coderay](https://github.com/rubychan/coderay) from 1.1.2 to 1.1.3.
- [Release notes](https://github.com/rubychan/coderay/releases)
- [Changelog](https://github.com/rubychan/coderay/blob/master/Changes.textile)
- [Commits](https://github.com/rubychan/coderay/compare/v1.1.2...v1.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-01 10:21:46 -04:00
c2abf88a61 UX: Adjustments to topic admin menu on mobile (#9945) 2020-06-01 09:39:38 -04:00
921751f128 UX: Remove box-shadow from kbd, unify styling (#9948)
Having many elements with multiple box-shadows (e.g. in keyboard shortcuts modal) was tanking scrolling performance in some browsers.
2020-06-01 15:00:56 +02:00
ef8e44af73 FIX: Don't change the button height when spinner appears
on the exception page.
2020-06-01 14:15:41 +02:00
57e587f39f DEV: removes dead code of dropdown-menu (#9942) 2020-06-01 11:22:35 +02:00
6ed3dbef03 UX: Fix border radius artifacts on dashboard pills (#9949) 2020-06-01 11:21:07 +02:00
40c4a8e3fc DEV: skips/tweaks brittle tests (#9952) 2020-06-01 11:09:34 +02:00
82de9c5308 DEV: add countTags to topic tracking state
This introduces a new core API to get counts per tag from topic
tracking state

This API will only be useful if a plugin enable tags in topic
tracking state using

`TopicTrackingState.include_tags_in_report = true`
2020-06-01 17:05:24 +10:00
32735be5bd DEV: Fix publish to message_bus when forcing pg readonly. 2020-06-01 13:26:12 +08:00
389bdcf5ab DEV: Fix implementation for DiscourseRedis#exists. 2020-06-01 13:11:32 +08:00
00aab49829 FIX: Restore the ability to rebake posts in deleted topics (#9951)
Lost in #9852
2020-06-01 07:04:16 +02:00
2c3ff3e524 DEV: Missing readonly mode banner when forcing PG readonly. 2020-06-01 12:25:27 +08:00
27ad562ff5 DEV: Rubocop fix 2020-06-01 06:07:07 +02:00
7df688d108 FIX: Handle files removed between glob and mtime 2020-06-01 05:50:50 +02:00
9ee77eae98 FIX: z helper doesn't resolve inside calc
It resulted in invalid `z-index: calc(z("tooltip") - 100)` in the output CSS. `calc` wasn't necessary here anyway since both operands are constant.
2020-06-01 05:50:50 +02:00
7bcee784c8 DEV: Remove an obsolete comment
Its first part was removed with other changes and this one got displaced after a `prettier` pass.
2020-06-01 05:50:49 +02:00
754a255ef7 UX: Remove the period after "Enable Notifications" button 2020-06-01 05:50:49 +02:00
7ac9a79ecb UX: Fix inputs alignment in admin/customize/colors 2020-06-01 05:50:49 +02:00
4babdf510b DEV: Update facter usage
`Facter.reset` (65d167eac9/lib/facter.rb (L126-L137)) clears `Facter::Options[:external_dir]` which seems to be the 4.x equivalent of `Facter::Util::Config.external_facts_dirs`.

This commit also makes sure that version 4.0 or higher is installed.
2020-06-01 05:50:49 +02:00
8c8391c742 DEV: Don't require wget in script/bench 2020-06-01 05:50:48 +02:00
9a6ef80739 FEATURE: notify admins about old credentials (#9918)
* FEATURE: notify admins about old credentials

Security and API keys should be renewed periodically.
This additional notification should help admins keep their Discourse safe and secure.
2020-06-01 13:49:27 +10:00
b0b37bf5a3 DEV: Add force rails_over switch via Redis. 2020-06-01 11:23:58 +08:00
df62407f35 DEV: Implement multiple keys support for DiscourseRedis#exists. 2020-06-01 11:20:26 +08:00
3894555b2e DEV: Prefer Discourse.redis.reconnct. 2020-06-01 10:55:53 +08:00