{"record":{"id":"19a6da8ef85ffaa0","repo":"discourse/discourse","slug":"raise-discourse-invalidparameters-new-setting-na","errorCode":null,"errorMessage":"raise Discourse::InvalidParameters.new(:setting_name) unless theme_setting","messagePattern":"raise Discourse::InvalidParameters\\.new\\(:setting_name\\) unless theme_setting","errorType":"exception","errorClass":"Discourse::InvalidParameters","httpStatus":400,"severity":"error","filePath":"app/controllers/admin/themes_controller.rb","lineNumber":376,"sourceCode":"        end\n      end\n      on_failed_policy(:current_user_is_admin) { raise Discourse::InvalidAccess }\n      on_failed_policy(:ensure_setting_is_themeable) do\n        render_json_error(I18n.t(\"themes.setting_not_themeable\", name: params[:name]), status: 400)\n      end\n      on_model_not_found(:theme) { raise Discourse::NotFound }\n    end\n  end\n\n  def schema\n  end\n\n  def objects_setting_metadata\n    theme = Theme.find_by(id: params[:id])\n    raise Discourse::InvalidParameters.new(:id) unless theme\n\n    theme_setting = theme.settings[params[:setting_name].to_sym]\n    raise Discourse::InvalidParameters.new(:setting_name) unless theme_setting\n\n    render_serialized(theme_setting, ThemeObjectsSettingMetadataSerializer, root: false)\n  end\n\n  def update_source\n    @theme = Theme.include_relations.find_by(id: params[:id])\n    raise Discourse::InvalidParameters.new(:id) unless @theme\n    raise Discourse::InvalidParameters.new(:remote_theme) unless @theme.remote_theme&.is_git?\n\n    remote_url = params[:remote_url]&.strip\n    raise Discourse::InvalidParameters.new(:remote_url) if remote_url.blank?\n\n    if remote_url.length > MAX_REMOTE_LENGTH\n      error = I18n.t(\"themes.import_error.not_allowed_theme\", { repo: remote_url[0..100] })\n      return render_json_error(error, status: 422)\n    end\n\n    begin","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/discourse/discourse/blob/1b2d7253e854205d2c95c80b2c6a1cdd42e45059/app/controllers/admin/themes_controller.rb#L358-L394","documentation":"Error \"raise Discourse::InvalidParameters.new(:setting_name) unless theme_setting\" thrown in discourse/discourse.","triggerScenarios":"Thrown at app/controllers/admin/themes_controller.rb:376 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1b2d7253e854205d2c95c80b2c6a1cdd42e45059","analyzedAt":"2026-08-26T03:11:08.302Z","schemaVersion":2},"datasetVersion":"2026-08-26T07:17:17.940Z"}