Giter Site home page Giter Site logo

friendsofflarum / default-user-preferences Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 3.0 264 KB

Enable emails for replies and mentions by default in user preferences

License: MIT License

PHP 76.33% TypeScript 21.73% JavaScript 0.76% Less 1.18%
flarum friendsofflarum

default-user-preferences's Introduction

Default User Preferences by FriendsOfFlarum

License Latest Stable Version

A Flarum extension.

Enables the following preferences by default for all new user signing up to your forum, with toggles in the extension settings to modify your chosen defaults.:

  • 'Someone replies to one of my posts (email) notification'
  • 'Someone mentions me in a post (email) notification'
  • 'Follow after reply'

Extending

Additional extensions may register defaults on the following way:

In your extension extend.php

(new \FoF\DefaultUserPreferences\Extend\RegisterUserPreferenceDefault())
    ->register(THE PREFERENCE KEY, THE DEFAULT VALUE),

Be sure to include translations in the fof-default-user-preferences.admin.settings namespace with the key matching the PREFERENCE KEY provided in the extender above. For example:

fof-default-user-preferences.admin.settings.myCoolKey

Installation

Install manually with composer:

composer require fof/default-user-preferences:"*"

Updating

composer update fof/default-user-preferences

Links

An extension by FriendsOfFlarum.

default-user-preferences's People

Contributors

dependabot[bot] avatar dsevillamartin avatar flarum-bot avatar imorland avatar karaok491 avatar piotr-tokarczyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

default-user-preferences's Issues

Type hint error on PHP <8.0

Bug Report

Current Behavior
Latest version of extension doesn't work on PHP 7.4

PHP Fatal error: Uncaught TypeError: Argument 2 passed to FoF\DefaultUserPreferences\Extend\RegisterUserPreferenceDefault::default() must be an instance of FoF\DefaultUserPreferences\Extend\mixed, int given, called in /home/odieshos/domain.com/vendor/fof/nightmode/extend.php on line 61 and defined in /home/odieshos/domain.com/vendor/fof/default-user-preferences/src/Extend/RegisterUserPreferenceDefault.php:33

Steps to Reproduce
Try using with PHP <8.0
Probably needs one of the other extension that provide integration, like the latest version of fof/nightmode

Expected Behavior
Extension should support PHP 7.3 and 7.4 or define an explicit 8.0 requirement.

Environment

  • Flarum version: 1.3.1
  • Extension version: 1.1.0
  • PHP version: 7.4
Flarum core 1.3.1
PHP version: 7.4.30
MySQL version: 8.0.29-cll-lve
Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bz2, calendar, ctype, curl, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, mbstring, tokenizer, xml, i360, bcmath, dbase, dom, fileinfo, gd, json, propro, raphf, http, igbinary, imagick, imap, intl, exif, mysqli, mysqlnd, OAuth, PDO, pdo_mysql, pdo_sqlite, Phar, posix, redis, soap, sockets, xmlreader, xmlwriter, xsl, yaml, zip, ionCube Loader
+------------------------------------------+---------+--------+
| Flarum Extensions | | |
+------------------------------------------+---------+--------+
| ID | Version | Commit |
+------------------------------------------+---------+--------+
| flarum-flags | v1.3.0 | |
| flarum-subscriptions | v1.3.1 | |
| flarum-tags | v1.3.0 | |
| flarum-approval | v1.3.0 | |
| flarum-suspend | v1.3.1 | |
| flarum-lock | v1.3.0 | |
| flarum-markdown | v1.3.0 | |
| flarum-likes | v1.3.0 | |
| flarum-bbcode | v1.3.0 | |
| flarum-sticky | v1.3.0 | |
| afrux-forum-widgets-core | v0.1.7 | |
| fof-follow-tags | 1.1.5 | |
| fof-impersonate | 1.1.0 | |
| fof-byobu | 1.1.6 | |
| sycho-advanced-extension-categories | v0.1.3 | |
| zerosonesfun-up | 1.0 | |
| zerosonesfun-inline-audio | 2.0 | |
| zerosonesfun-essential-audio | 0.3 | |
| zerosonesfun-direct-links | 2.2 | |
| zerosonesfun-bbcode-button | 1.1.2 | |
| v17development-user-badges | v0.2.1 | |
| v17development-seo | v1.8.0 | |
| v17development-blog | 0.4.2 | |
| therealsujitk-gifs | v4.1.1 | |
| the-turk-diff | 1.1.1 | |
| sycho-profile-cover | v1.3.2 | |
| serakoi-verified-badge | 0.0.3 | |
| ramesh-dada-realtime | 100.1 | |
| ramesh-dada-gui-image-and-link | 1.0 | |
| noriods-auto-more | v1.0.0 | |
| nomiscz-auth-steam | v1.0.1 | |
| nearata-no-self-likes | v1.2.0 | |
| nearata-cakeday | v2.0.0 | |
| malago-ads | 0.3.2 | |
| littlecxm-reply-to-see | 1.0.2 | |
| kilowhat-audit-free | 1.5.1 | |
| justoverclock-welcomebox | 1.3.6 | |
| justoverclock-thread-read-time | 0.1.7 | |
| justoverclock-hashtag | 1.0.1 | |
| justoverclock-feedback | 0.1.9 | |
| justoverclock-emoticonpack | 0.1.2 | |
| justoverclock-edit-posts | 0.1.1 | |
| justoverclock-custom-html-widget | 0.1.4 | |
| justoverclock-broken-links-checker | 0.1.1 | |
| isamuraii-op-dark-mode-tuning | 0.2 | |
| ianm-same-page-admin | 0.1.0 | |
| ianm-html-head | 1.1.0 | |
| ianm-follow-users | 1.1.1 | |
| fof-webhooks | 1.0.6 | |
| fof-username-request | 1.0.1 | |
| fof-user-bio | 1.1.0 | |
| fof-upload | 1.2.3 | |
| fof-terms | 1.1.2 | |
| fof-split | 1.0.1 | |
| fof-spamblock | 1.0.2 | |
| fof-socialprofile | 1.1.4 | |
| fof-sitemap | 1.0.3 | |
| fof-share-social | 1.1.0 | |
| fof-reactions | 1.1.0 | |
| fof-profile-image-crop | 1.0.1 | |
| fof-prevent-necrobumping | 1.0.1 | |
| fof-polls | 1.1.0 | |
| fof-pages | 1.0.4 | |
| fof-oauth | 1.2.2 | |
| fof-moderator-notes | 1.1.0 | |
| fof-links | 1.1.1 | |
| fof-linguist | 1.0.4 | |
| fof-ignore-users | 1.1.0 | |
| fof-html-errors | 1.1.0 | |
| fof-github-autolink | 1.0.0 | |
| fof-formatting | 1.0.2 | |
| fof-drafts | 1.1.2 | |
| fof-discussion-thumbnail | 1.1.0 | |
| fof-default-user-preferences | 1.1.0 | |
| fof-cookie-consent | 1.1.0 | |
| fof-best-answer | 1.2.2 | |
| fof-bbcode-tabs | 1.0.2 | |
| fof-bbcode-details | 1.0.0 | |
| fof-ban-ips | 1.0.2 | |
| flarumtr-mobile-search | v1.2 | |
| flarumite-simple-spoilers | 1.0.0 | |
| flarum-statistics | v1.3.0 | |
| flarum-pusher | v1.3.0 | |
| flarum-mentions | v1.3.1 | |
| flarum-lang-turkish | 1.3.1.2 | |
| flarum-emoji | v1.3.0 | |
| dem13n-topic-starter-label | 0.1.8 | |
| davwheat-custom-sidenav-links | 1.0.1 | |
| datlechin-pronouns | v0.1.0 | |
| datlechin-posted-on | v0.1.6 | |
| datlechin-keyboard-shortcuts | v0.1.1 | |
| datlechin-bbcode-hide-content | v0.1.0 | |
| datlechin-add-like-controls | v1.0.6 | |
| clarkwinkelmann-status | 1.0.0 | |
| clarkwinkelmann-shadow-ban | 1.1.0 | |
| clarkwinkelmann-scratchpad | 1.5.1 | |
| clarkwinkelmann-predefined-avatars | 1.0.1 | |
| clarkwinkelmann-popular-discussion-badge | 1.1.0 | |
| clarkwinkelmann-mailing | 1.0.0 | |
| clarkwinkelmann-emojionearea | 1.0.0 | |
| clarkwinkelmann-editable-user-attributes | 1.0.0 | |
| clarkwinkelmann-create-user-modal | 1.3.0 | |
| clarkwinkelmann-comicsans | 1.0.0 | |
| clarkwinkelmann-circle-groups | 1.0.1 | |
| clarkwinkelmann-author-change | 1.0.2 | |
| blomstra-notification-deleter | 0.2.1 | |
| askvortsov-rich-text | v2.1.7 | |
| askvortsov-pwa | v3.1.3 | |
| askvortsov-moderator-warnings | v0.6.1 | |
| askvortsov-checklist | v1.3.1 | |
| askvortsov-categories | v3.0.6 | |
| antoinefr-bbcode-fa | v1.0.0 | |
| afrux-top-posters-widget | v0.1.4 | |
| afrux-online-users-widget | v0.1.6 | |
| afrux-news-widget | v0.1.1 | |
| afrux-forum-stats-widget | v0.1.1 | |
| afrux-asirem | v0.1.7 | |
| acpl-mobile-tab | 1.1.0 | |
| 2nrwls-audio | v3.0 | |
+------------------------------------------+---------+--------+

Possible solution(s)
mixed typing isn't available before PHP 8.0

It seems to be used in 2 different places in the extension, introduced in #3

public function default(string $key, mixed $value, string $type)

private function getDefault(string $key): mixed

Additional Context
Reported at https://discuss.flarum.org/d/31088-an-error-about-fof-night-mode

Something similar was just fixed in core by luceos. Coincidence? flarum/framework@9532b71

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.