Not a bug Please add quotes around thread titles in push notifications

Steffen

Well-known member
Affected version
2.1.0
Phrases like "x_replied_to_thread_y_may_be_more", "x_quoted_your_post_in_thread_y" and "x_mentioned_you_in_post_in_thread_y" don't use quotes around the thread title because they have originally been introduced for alerts where the title is highlighted by being a link. However, these phrases are also used in push notifications which are just plain text. I therefore think it would make sense to add quotes around thread titles in push notifications.

(Instead of duplicating all those phrases for push notifications, I'd add the quotes to the templates which are calling the "phrase" function.)
 
There isn't a particular reason we chose not to encapsulate the thread titles a bit (note it potentially applies to many different content types, arguably even usernames at that point for consistency) but we just didn't. Our approach wasn't inherently wrong, your idea for changing it isn't wrong either. But frankly, at this point, it is just what it is.

My only slightly thin argument for not doing it now is that we'd have to do fairly ugly quote escaping or string concatenation to make it happen...
Code:
'title': "\"{$thread.title}\""
Or
Code:
'title': '"' . $thread.title . '"'
Maybe we could use a template filter to just wrap the variable value in quotes, but that would then create a backwards dependency, i.e. you wouldn't be able to use a 2.1.1 style on a 2.1.0 installation (if those templates are modified for any reason) because the template filters wouldn't exist. And this would affect as many as 70 templates in total.

I think we'll just have to accept that the way it is now is just the decision that was made at the time.

Overall it's a design choice and personally I don't see a huge benefit or compelling reason to change it, so we'll pass on this for now, thanks.
 
Back
Top Bottom