Closed letitbe13 closed 1 year ago
Hi,
What is your exact intent with the code? If you could share it with us, there might be a different approach that could solve the problem.
Thanks!
Hi,
What is your exact intent with the code? If you could share it with us, there might be a different approach that could solve the problem.
Thanks!
Thank you. I need to do a deep project report, based on all it issues including issues of all subprojects. I don’t need to update any issue, just read standard and custom fields. When I form an array of all issues that I’m going to deal with, unintentionally, cw of subproject issues start, and I can see it in a log. If I disable all cw for issues, I still can see in a log “running share code” for each subproject issue. How can I read issues properties from “Project before save cw” without running their custom workflows?..
I've just tested it and it works as expected. Here is my my CW and the corresponding log output after a project save (I've 15 issues in the parent project and one issue in the sub-project):
Rails.logger.info ">>> Project #{self.name} is being updated"
all_issues = self.issues
self.children.select{|child| child.active?}.each do |child|
all_issues.concat child.issues
end
Rails.logger.info ">>> #{all_issues.size} issues"
Rails.logger.info '>>> Done'
= Running shared code for Project (#3342) "c1"
= Finished running shared code for Project (#3342) "c1"
= Running before_save custom workflows for Project (#3342) "c1"
== Running before_save custom workflow "c1"
>>> Project c1 is being updated
>>> 16 issues
>>> Done
= Finished running before_save custom workflows for Project (#3342) "c1"
= Running after_save custom workflows for Project (#3342) "c1"
= Finished running after_save custom workflows for Project (#3342) "c1"
Hi! This is the only active cw in my redmine 3.4.6 (I reduced it to the minimum that still produces strange behavior) Project before_save:
Production.log after project update (see my comments ###):
If I don't mention children.issues in cw code, it doens't happen. How can I avoid running shared code for issues? I even don't understand what the code it is. I don't ask to update or save any issue...