{"record":{"id":"eff31a790676e213","repo":"instructure/canvas-lms","slug":"no-long-name-given-for-abstract-course-abstract-course-id","errorCode":null,"errorMessage":"No long_name given for abstract course #{abstract_course_id}","messagePattern":"No long_name given for abstract course #(.+?)","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/abstract_course_importer.rb","lineNumber":51,"sourceCode":"      importer.success_count\n    end\n\n    class Work\n      attr_accessor :success_count, :abstract_courses_to_update_sis_batch_id, :roll_back_data\n\n      def initialize(batch, root_account, logger)\n        @batch = batch\n        @root_account = root_account\n        @abstract_courses_to_update_sis_batch_id = []\n        @roll_back_data = []\n        @logger = logger\n        @success_count = 0\n      end\n\n      def add_abstract_course(abstract_course_id, short_name, long_name, status, term_id = nil, account_id = nil, fallback_account_id = nil)\n        raise ImportError, \"No abstract_course_id given for an abstract course\" if abstract_course_id.blank?\n        raise ImportError, \"No short_name given for abstract course #{abstract_course_id}\" if short_name.blank?\n        raise ImportError, \"No long_name given for abstract course #{abstract_course_id}\" if long_name.blank?\n        raise ImportError, \"Improper status \\\"#{status}\\\" for abstract course #{abstract_course_id}\" unless /\\Aactive|\\Adeleted/i.match?(status)\n        return if @batch.skip_deletes? && status =~ /deleted/i\n\n        course = AbstractCourse.find_by(root_account_id: @root_account, sis_source_id: abstract_course_id)\n        course ||= AbstractCourse.new\n        unless course.stuck_sis_fields.include?(:enrollment_term_id)\n          course.enrollment_term = @root_account.enrollment_terms.find_by(sis_source_id: term_id) || @root_account.default_enrollment_term\n        end\n        course.root_account = @root_account\n\n        account = nil\n        account = @root_account.all_accounts.find_by(sis_source_id: account_id) if account_id.present?\n        account ||= @root_account.all_accounts.find_by(sis_source_id: fallback_account_id) if fallback_account_id.present?\n        course.account = account if account\n        course.account ||= @root_account\n\n        # only update the name/short_name on new records, and ones that haven't been changed\n        # since the last sis import","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/abstract_course_importer.rb#L33-L69","documentation":"add_abstract_course requires a non-blank long_name (the display course name). A course without a human-readable name is rejected with ImportError identifying the abstract_course_id. This completes the trio of required-field validations (id, short_name, long_name) performed before any persistence.","triggerScenarios":"Calling add_abstract_course(id, short_name, nil/'', status) — a SIS courses.csv row with an empty long_name column (lib/sis/abstract_course_importer.rb:51).","commonSituations":"Source system rows lacking a display name; extract scripts mapping the wrong column to long_name; partially filled migration spreadsheets.","solutions":["Populate long_name in the SIS data for the named course.","Fix the column mapping in the export/parsing step.","Default long_name from short_name (or vice versa) in your wrapper when blank."],"exampleFix":"// before\nimporter.add_abstract_course('C1', 'CS101', '', 'active')\n// after\nlong = row['long_name'].presence || row['short_name']\nimporter.add_abstract_course('C1', 'CS101', long, 'active')","handlingStrategy":"validation","validationCode":"# Ruby\nraise 'blank long_name' if row['long_name'].to_s.strip.empty?\nimporter.add_abstract_course(row['course_id'], row['short_name'], row['long_name'], row['status'])","typeGuard":null,"tryCatchPattern":"begin\n  importer.add_abstract_course(id, short, long, status)\nrescue SIS::AbstractCourseImporter::ImportError => e\n  warnings << \"Abstract course #{id}: #{e.message}\"\nend","preventionTips":["Validate the full required field set (id, short_name, long_name) in one pre-flight pass.","Default long_name from short_name only as an explicit policy.","Log the offending abstract_course_id (the importer already includes it) to speed data fixes."],"tags":["sis","import","validation","missing-field"],"backgroundTag":"missing-required-argument","analyzedSha":"1c9f0bb8013ed69c4f2efe11fd483025469b7e6c","analyzedAt":"2026-09-15T20:33:18.891Z","contentChangedAt":"2026-09-15T20:33:18.891Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}