Fix reminder notification#323
Conversation
|
Thanks for digging into this, @yurabakhtin! The param-passing fix in Web vs. mail rendering isn't driven by the request type — it's driven by the target/renderer. HumHub already separates them:
Both views already exist in the module:
So with a constant On the "layout was developed for Email mode" point — I don't think that's the case. Also note a side effect of the current approach: in a web request Suggested alternatives:
Either way, the view selection belongs to the target/renderer, not the execution context. |
luke-
left a comment
There was a problem hiding this comment.
Thanks @yurabakhtin — this is exactly Option B, nicely done. I diffed the new layouts/remind.php against core's @notification/views/layouts/web.php: it's a 1:1 copy plus the "Reminder" badge, and with the constant viewName = 'remind' both targets now resolve correctly (web → views/remind.php, mail → views/mails/remind.php via subPath). The BS5 markup it mirrors has been in core since 1.18.0-beta.2, so the current minVersion is fine.
Nice side effect of the validation change: the old $remindModes array was missing REMIND_ONE_WEEK, so "1 Week before" would have failed validation — array_keys(getRemindModeItems()) fixes that. I also verified the removed $remindModes / getRemindMode() aren't referenced anywhere else.
One small thing before merge (see inline suggestion): views/remind.php doesn't pass relativeUrl through to the layout, so $relativeUrl ?? $url always falls back to the absolute URL — unlike all other notifications in the dropdown. Nit: trailing newline at the end of views/remind.php is missing.



#322