Mark as read button: config for the size#7314
Conversation
|
(Let's try to release 1.26.0 soon, so focussing mostly on regressions) |
| FreshRSS_Context::userConf()->lazyload = Minz_Request::paramBoolean('lazyload'); | ||
| FreshRSS_Context::userConf()->sides_close_article = Minz_Request::paramBoolean('sides_close_article'); | ||
| FreshRSS_Context::userConf()->sticky_post = Minz_Request::paramBoolean('sticky_post'); | ||
| FreshRSS_Context::userConf()->mark_read_button = Minz_Request::paramStringNull('mark_read_button') ?? 'big'; |
There was a problem hiding this comment.
I do not understand the issue here:
Check failure on line 134 in app/Controllers/configureController.php
GitHub Actions / tests
Property FreshRSS_UserConfiguration::$mark_read_button ('big'|'none'|'small') does not accept string.
There was a problem hiding this comment.
It is because you have not checked that the string is only 'big'|'none'|'small'.
You may do so with e.g. in_array()
There was a problem hiding this comment.
Thanks for the help.
Would it make sense to have a function similar to Minz_Request::paramStringNull that have the check implemented too?
There was a problem hiding this comment.
Would it make sense to have a function similar to
Minz_Request::paramStringNullthat have the check implemented too?
I did a quick test but did not found how to do that in a way that is understood by PHPStan, so keeping it simple for now, but help welcome with another proposition that works.
fix of #7489 (comment) Regression #7314
Closes #7310 and #2016
default: big

small:

none:

benefit:
user can decide which button fits best. The big button has advantages ans disadvantages.