  def self.get_tmpl_folder

    tmpl_folder = Folder.where(name: TMPL_ROOT).first

    if tmpl_folder.nil?

      ary = self.setup_tmpl_folder

      unless ary.nil? or ary.empty?
        tmpl_folder = ary[0]
        tmpl_system_folder = ary[1]
        tmpl_workflows_folder = ary[2]
        tmpl_local_folder = ary[3]
        tmpl_q_folder = ary[4]
      end

    else

      folders = Folder.where("parent_id=#{tmpl_folder.id}").to_a
      unless folders.nil?
        folders.each do |child|
          case child.name
            when TMPL_SYSTEM
              tmpl_system_folder = child
            when TMPL_WORKFLOWS
              tmpl_workflows_folder = child
            when TMPL_LOCAL
              tmpl_local_folder = child
            when TMPL_RESEARCH
              tmpl_q_folder = child
          end
        end
      end
    end
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.