gitlab-org--gitlab-foss/lib/banzai
Stan Hu 0e341a6e58 Fix attachments using the wrong URLs in e-mails
Prior to https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/29889,
only the project context were set for the Markdown renderer. For a note
on an issuable, the group context was set to `nil` because
`note.noteable.try(:group)` attempted to get the issuable's group, which
doesn't exist.

To make group notifications work, now both the project and group context
are set. The context gets passed to `RelativeLinkFilter`, which
previously assumed that it wasn't possible to have both a group and a
project in the Markdown context. However, if a group were defined, it
would take precedence, and the URL rendered for uploads would be
`/group/-/uploads` instead of `/group/project/uploads/`. This led to
404s in e-mails.

However, now that we have both project and group in the context, we
render the Markdown giving priority to the project context if is set.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63910
2019-06-28 22:08:46 -07:00
..
filter Fix attachments using the wrong URLs in e-mails 2019-06-28 22:08:46 -07:00
pipeline Allow emoji in label and milestone references 2019-06-07 10:05:57 +01:00
reference_parser [CE] Support multiple assignees for merge requests 2019-04-08 18:40:00 -03:00
renderer/common_mark Remove Redcarpet markdown engine 2019-02-04 12:48:35 +01:00
color_parser.rb Run rubocop -a on CE files 2019-05-05 03:24:28 -07:00
commit_renderer.rb Use Redis for CacheMarkDownField on non AR models 2019-06-05 13:19:59 +08:00
cross_project_reference.rb Enable more frozen string in lib/**/*.rb 2018-10-06 17:02:50 -07:00
filter.rb Enable more frozen string in lib/**/*.rb 2018-10-06 17:02:50 -07:00
filter_array.rb Enable more frozen string in lib/**/*.rb 2018-10-06 17:02:50 -07:00
issuable_extractor.rb Prepare Banzai to work with group issuables 2018-10-31 16:04:48 +01:00
object_renderer.rb Enable more frozen string in lib/**/*.rb 2018-10-06 17:02:50 -07:00
pipeline.rb Enable more frozen string in lib/**/*.rb 2018-10-06 17:02:50 -07:00
querying.rb Enable more frozen string in lib/**/*.rb 2018-10-06 17:02:50 -07:00
redactor.rb Fix url redaction for issue links 2019-05-03 15:09:20 +02:00
reference_extractor.rb Enable more frozen string in lib/**/*.rb 2018-10-06 17:02:50 -07:00
reference_parser.rb Enable more frozen string in lib/**/*.rb 2018-10-06 17:02:50 -07:00
render_context.rb
renderer.rb Enable more frozen string in lib/**/*.rb 2018-10-06 17:02:50 -07:00
request_store_reference_cache.rb Enable more frozen string in lib/**/*.rb 2018-10-06 17:02:50 -07:00