rails / mission_control-jobs

Dashboard and Active Job extensions to operate and troubleshoot background jobs
MIT License
586 stars 66 forks source link

dom_id must be passed a record_or_class as the first argument, you passed false #148

Closed lgeorgiev closed 2 months ago

lgeorgiev commented 2 months ago

After upgrading to Rails 7.2, Solid Queue 0.4.1 and Mission Control 0.3.0 I get the following error when I try to open the Finished Jobs page.

dom_id must be passed a record_or_class as the first argument, you passed false
SELECT arguments FROM solid_queue_jobs;
{
    "job_class": "Noticed::EventJob",
    "job_id": "a4cb87fd-3cc6-4733-8eee-7e75d42d4325",
    "provider_job_id": null,
    "queue_name": "default",
    "priority": null,
    "arguments": [
    {
        "_aj_globalid": "gid://app-1/EmailNotifier/4"
    }],
    "executions": 0,
    "exception_executions":
    {},
    "locale": "bg",
    "timezone": "UTC",
    "enqueued_at": "2024-08-10T19:33:47.325611625Z",
    "scheduled_at": "2024-08-10T19:33:47.325326538Z",
    "current_tenant": "gid://app-1/Account/1"
}
rosa commented 2 months ago

Thanks for the report! I'll try to look into this one soon.

rosa commented 2 months ago

He @lgeorgiev, could you share the full trace for that error? I haven't managed to reproduce this.

lgeorgiev commented 2 months ago
  def form_for(name, **args, &block)
    form_content = super
    args = args.merge({ id: "#{dom_id args[:model]}_form" }) if args[:id].blank? && !args[:model].nil?
    return form_content if skip_form_wrapper(form_content) || args[:skip_wrapper] == true || !args[:model].new_record?

    form_wrapper(form_content)
  end

  def form_with(**options, &block)
    options = options.merge({ builder: BootstrapForm::FormBuilder })
    options = options.merge({ id: "#{dom_id options[:model]}_form" }) if options[:id].blank? && !options[:model].nil?
    form_content = super
    if skip_form_wrapper(form_content) || options[:skip_wrapper] == true || !options[:model].new_record?
      return form_content
    end

    form_wrapper(form_content)
  end

Hi @rosa, it's probably my mistake. I am trying to override the form_with and form_for methods. For the other forms it works. The strange thing is that before the upgrade there was no problem with mission control.