danmunn / redmine_dmsf

Fork of svn repository for redmine_dmsf
GNU General Public License v2.0
413 stars 193 forks source link

Adds an extra check in DmsfQuery#dmsf_node #1505

Closed liaham closed 4 months ago

liaham commented 5 months ago

This change stablizes the query with DmsfLink objects since they could have stored a project_id of -1 causing a nil error.

This may happen when the linking of a dms document with an issue was not successful or aborted as observed with https://github.com/danmunn/redmine_dmsf/pull/1466.

picman commented 4 months ago

@liaham Could you update your pull request accordingly, please? So, I can merge it?

liaham commented 4 months ago

Hi @picman, there is nothing to update. I made the pull request at January 30th. Your last commit on devel was on January 9th. Or did I oversee something?

picman commented 4 months ago

I suggest modifying your pull request as follows:

  if dmsf_link.dmsf_folder
    !dmsf_link.dmsf_folder.visible? || !DmsfFolder.permissions?(dmsf_link.dmsf_folder, allow_system: false)          
--elsif dmsf_link.project
--  !dmsf_link.project.dmsf_available?
++ else
++  !dmsf_link.project&.dmsf_available?
  end
picman commented 4 months ago

Thank you!