GEWIS / gewisweb

GEWIS Website
https://gewis.nl
GNU General Public License v3.0
16 stars 33 forks source link

`Markdown` view helper does not allow `null` for `text` argument #1820

Closed tomudding closed 5 months ago

tomudding commented 5 months ago

Current behaviour

A lot of historical data of activities does not have correct localisation, as such null is always passed to https://github.com/GEWIS/gewisweb/blob/24d805e55de0c786afc21c0e39428060230c227d/module/Application/src/View/Helper/Markdown.php#L24-L27

This is not allowed and a 500 is returned.

Desired behaviour

Allow null and automatically change it to '' (empty string).

Steps to reproduce

https://gewis.nl/en/activity/view/2063

Website version

latest

What operating are you seeing the problem on?

No response

What browsers are you seeing the problem on?

No response

Other information

No response

tomudding commented 5 months ago

Perhaps it is actually better to change the LocaliseText view helper instead. Never have it return null but '' (empty string) instead.