{"record":{"id":"1821721ed771ae13","repo":"forem/forem","slug":"this-lead-form-is-no-longer-active","errorCode":null,"errorMessage":"This lead form is no longer active","messagePattern":"This lead form is no longer active","errorType":"exception","errorClass":"StandardError","httpStatus":null,"severity":"error","filePath":"app/liquid_tags/org_lead_form_tag.rb","lineNumber":10,"sourceCode":"class OrgLeadFormTag < LiquidTagBase\n  PARTIAL = \"liquids/org_lead_form\".freeze\n  VALID_CONTEXTS = %w[Organization].freeze\n\n  def initialize(_tag_name, input, _parse_context)\n    super\n    @form_id = parse_form_id(input)\n    @form = OrganizationLeadForm.find_by(id: @form_id)\n    raise StandardError, I18n.t(\"liquid_tags.org_lead_form_tag.not_found\") unless @form\n    raise StandardError, I18n.t(\"liquid_tags.org_lead_form_tag.inactive\") unless @form.active?\n\n    source = parse_context.partial_options[:source]\n    unless @form.organization_id == source.id\n      raise StandardError, I18n.t(\"liquid_tags.org_lead_form_tag.wrong_organization\")\n    end\n  end\n\n  def render(_context)\n    ApplicationController.render(\n      partial: PARTIAL,\n      locals: { form: @form },\n    )\n  end\n\n  private\n\n  def parse_form_id(input)\n    id = Integer(input.strip, exception: false)","sourceCodeStart":1,"sourceCodeEnd":28,"githubUrl":"https://github.com/forem/forem/blob/f354c376a7c5d1330dc40d66f150be8d1289020d/app/liquid_tags/org_lead_form_tag.rb#L1-L28","documentation":"After the lookup succeeds, OrgLeadFormTag checks @form.active? and raises when the record exists but is switched off. The form is fully present in the database; the organization has simply deactivated it, so the tag refuses to embed it. The error appears the moment the containing markdown is re-parsed (save, preview, or render) after the form is deactivated.","triggerScenarios":"Embedding {% org_lead_form 42 %} where form 42 exists but its active flag is false, for example the org paused the lead campaign or an admin deactivated the form in settings.","commonSituations":"Campaign ended and the form was switched off while landing pages still embed it; bulk form deactivation during a data migration; staging data where forms are created inactive by default.","solutions":["Reactivate the form in the organization's lead form settings so existing embeds render again","If deactivation was intentional, remove {% org_lead_form %} from the page markdown or replace it with a static CTA","Verify state in console before touching the markdown: OrganizationLeadForm.find(42).active?"],"exampleFix":"// before: form 42 exists but is deactivated\n{% org_lead_form 42 %}\n\n// after (option A: reactivate form 42 in org settings, keep embed)\n{% org_lead_form 42 %}\n\n// after (option B: deactivation was intentional, drop the tag)\nSubscribe to our newsletter!","handlingStrategy":"validation","validationCode":"return if params[:embed_form_id].blank?\n\nform = OrganizationLeadForm.find_by(id: params[:embed_form_id])\nif form&.active?\n  body << \"{% org_lead_form #{form.id} %}\"\nelse\n  errors.add(:embed_form_id, 'form is missing or inactive')\nend","typeGuard":"def lead_form_active?(form_id)\n  OrganizationLeadForm.find_by(id: form_id)&.active? == true\nend","tryCatchPattern":"begin\n  Liquid::Template.parse(body_markdown)\nrescue StandardError => e\n  errors.add(:body_markdown, \"Liquid tag error: #{e.message}\") # 'no longer active'\nend","preventionTips":["Treat deactivating a form as a breaking change: first grep pages embedding its ID","Prefer removing embeds and then deactivating, never the reverse","Verify with OrganizationLeadForm.find(id).active? before publishing page edits"],"tags":["liquid","forem","lead-form","inactive-resource","content-authoring"],"backgroundTag":"inactive-resource","analyzedSha":"f354c376a7c5d1330dc40d66f150be8d1289020d","analyzedAt":"2026-08-21T12:43:44.428Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}