discourse/discourse · error · Discourse::InvalidParameters

raise Discourse::InvalidParameters.new(:component)

Error message

raise Discourse::InvalidParameters.new(:component)

What it means

Error "raise Discourse::InvalidParameters.new(:component)" thrown in discourse/discourse.

Source

Thrown at app/controllers/admin/themes_controller.rb:553

      previous_value,
      new_value,
      @theme,
    )
  end

  def log_theme_component_disabled
    StaffActionLogger.new(current_user).log_theme_component_disabled(@theme)
  end

  def log_theme_component_enabled
    StaffActionLogger.new(current_user).log_theme_component_enabled(@theme)
  end

  def handle_switch
    param = theme_params[:component]
    if param.to_s == "false" && @theme.component?
      if @theme.id == SiteSetting.default_theme_id
        raise Discourse::InvalidParameters.new(:component)
      end
      @theme.switch_to_theme!
    elsif param.to_s == "true" && !@theme.component?
      if @theme.id == SiteSetting.default_theme_id
        raise Discourse::InvalidParameters.new(:component)
      end
      @theme.switch_to_component!
    end
  end

  # Overridden by theme-creator plugin
  def theme_user
    current_user
  end

  def ensure_theme_creation_is_allowed
    guardian.ensure_can_create_theme!
  end

View on GitHub (pinned to 1b2d7253e8)

When it happens

Trigger: Thrown at app/controllers/admin/themes_controller.rb:553 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of discourse/discourse@1b2d7253e8 (2026-08-26). Data as JSON: /api/errors/b71bd28e55958a05. Report an issue: GitHub.