Fixing extension forms for CKAN 2.12 CSRF protection

Custom templates and extension forms can break on CKAN 2.12 when the CSRF snippet is missing and the ignore_extensions option is gone. This page explains what changes, how to fix each form and how to test and roll back safely.

On this page

Why CKAN 2.12 forms break and how to fix them before cutover

A portal team moving to CKAN 2.12 will find that forms in custom templates and extensions stop working, and the fix is to add the CSRF snippet to every form that posts and to stop relying on the ignore_extensions option, which is no longer available. Start with the supported path: CKAN 2.12.0 was released on August 26, 2026, alongside maintenance releases 2.11.6 and 2.10.11 on the same day. Because CKAN minor releases may include backwards-incompatible changes, the safe route for most portals is to bring the site to the latest 2.11 patch first, confirm it runs cleanly, and then take the move to 2.12 as a separate, tested step. Patch releases do not break backwards compatibility, so the 2.11 line is the place to make form changes against a known baseline.

The practical work begins with an inventory. List every template and extension view that renders a <form> with a POST method, including custom dataset, organization and group forms, admin pages, and any plugin that adds its own settings screens. Each of these needs the CSRF token rendered inside the form, and each should be exercised in a staging copy on 2.11 with the same extensions and configuration as production. Where a form was previously accepted without a token, expect it to fail with a CSRF error rather than a visible template error, so testers should submit every form and record the result, not only load the page. Confirm with the owners of each custom extension whether they have published a 2.12-compatible release, because a fork that still assumes the old behavior will fail regardless of your template changes.

Treat the ignore_extensions removal as a configuration and code review task, not a single search and replace. Look for any place where the old option was set, including deployment configuration, extension code and documentation kept by your own team, and replace the workaround with the supported token handling. Before cutover, rerun the full form test list on a copy of production data, capture the results as evidence for your change record, and agree a rollback point with the operations owner. Also confirm the exact snippet name and token behavior against the CKAN 2.12 documentation for your release, since this page does not reproduce template internals.

What changes in CKAN 2.12 that affects extension forms

This table compares the two changes in CKAN 2.12 that affect custom forms, the impact of each, and the action to take before go-live. Read each row as a check against your own templates and extension code. The main takeaway is that the CSRF requirement affects every POST form, and the release policy means minor releases can carry changes like this one.

ChangeImpact on extension formsAction needed
Required CSRF snippet in POST formsForms that submit with POST without the CSRF token field are rejected, so saves, deletes and admin actions fail with an errorAdd the CSRF snippet to every custom POST form in templates, then test each form as a logged-in user
Removal of the ignore_extensions optionConfiguration that relied on this option to skip CSRF handling for extension routes no longer has an effectRemove the setting from config files, and confirm each extension route includes the token instead
Minor releases may include incompatible changesCKAN 2.12 is a minor release, so the release policy allows backwards-incompatible changes that patch releases would not carryReview the 2.12 changelog against your extensions before upgrading, and test in a separate environment first
Patch releases do not change compatibilityOnce you are on 2.12, later patch releases are not expected to introduce breaking changes or schema changesApply patches on a routine schedule, and still test forms after each patch
Extension forms with custom JavaScript submissionsAJAX or JavaScript-built requests may not include the token, so they can fail even when the page rendersConfirm each script sends the token with the request, and test the interaction in a browser
Python 3.10 and revision table removalThese are separate 2.12 changes and are not covered on this pageSee the CKAN 2.11 to 2.12 upgrade page for the full list of breaking changes

Inventory forms and tests before editing templates

Four checks come before any template or extension change. Together they show which forms need the CSRF snippet, which extensions could block the move, where changes can be tested safely, and how to recover if something goes wrong. Work through them in this order, since the form list sets how much the test environment must cover.

List every POST form

Search every custom template directory and installed extension for forms that submit a POST request, including plugin templates, admin configuration pages and forms built or submitted in JavaScript. Record the template path, the route each form posts to and the owner of each form in a shared sheet. Every form on that list needs the CSRF snippet before it works on CKAN 2.12, so the list becomes your work queue. Build it before you edit any file, because an untracked form is the one most likely to fail after go-live.

Check extension support for 2.12

For each installed extension, open its repository and confirm a release or documented support entry for CKAN 2.12. The ckanext-dcat repository lists support for CKAN 2.10 and 2.11, so a portal that depends on it should not assume 2.12 works until a newer release or tested fix is confirmed. Check ckanext-saml2auth and every other extension the same way, and treat any extension with no 2.12 entry as a blocker to resolve or replace before the upgrade.

ckanext-dcat repository

Build a separate test environment

Build a separate test environment on CKAN 2.12.0 with Python 3.10 or newer, PostgreSQL 12 or newer, Solr 9 and Redis. Use a recent copy of production data and the extension versions you verified, so the forms behave as they will in production. The install-from-source guide is the reference for dependencies, and Solr and Redis can run from Docker images if your team prefers containers. Submit each form in this environment with an active session and confirm that the CSRF token is rendered and accepted.

Install from source docs

Back up site, databases and configuration

Take a backup of the site files, the main PostgreSQL database, the DataStore database and the configuration before any template or extension edit. The DataStore keeps its data in a separate PostgreSQL database with its own users, so a dump of the main database alone leaves it out. Include the production ini file, environment variables, secret keys and custom static assets. Store the backup off the server and run a test restore in the test environment before you rely on it.

DataStore docs

How to add the CSRF snippet to custom forms

Every form in a custom template or extension that posts data to CKAN needs to carry the CSRF token field, because CKAN 2.12 rejects state-changing requests that arrive without one. The practical change is that each <form method="post"> in your templates must include the CSRF snippet that CKAN's own core templates use, so the token travels with the submission. Confirm the exact snippet path and the template helper that renders the token against the 2.12 documentation and the CKAN source tagged for the version you run, since helper names are the kind of detail that can change between releases. Do not copy a snippet from a blog post or from an older extension without checking it against the release in use.

Finding the affected forms is a search problem, not a visual check. Start by listing every template file in your custom theme and every extension template directory, then search for <form and method="post" (and any method="POST" variant). Next, search your Python code and configuration for the ignore_extensions option, because forms that depended on it to skip the protection need a different fix than forms that simply lack the token. Include JavaScript that builds forms or calls endpoints with POST, since those requests also need the token. Record each finding in a list with the file, the route it posts to and the owner, so the work can be tracked to completion.

Verify each form in a test environment that mirrors production, not on a developer laptop with relaxed settings. For every form, submit it with valid input, confirm the action completes and the expected flash message or redirect appears, then submit a request with the token removed or altered to confirm CKAN rejects it. Repeat the check for each user role that can reach the form, such as anonymous users, editors and organization admins, because a form can render for one role and fail for another. Keep a short test log with the date, environment, tester and result for each form, so the evidence is available if your security or compliance team asks how the change was validated.

Sequence for fixing and cutting over extension forms

This sequence moves each affected extension form from a broken state on CKAN 2.12 to a tested, deployed state, with a defined rollback point if the cutover fails. Each step closes with a check so the team knows whether to proceed.

  1. Inventory every custom form and template

    Your extension developer or internal platform owner lists every extension, custom template and page that renders a POST form, including login-adjacent pages, dataset and organization forms, and any AJAX calls that submit data. Record which extension owns each form, the CKAN version it was built for, and whether the form relies on the ignore_extensions option that CKAN 2.12 removed. The output is a register with one row per form. You know this step is done when a second person can read the register and identify every form without asking the author.

  2. Add the CSRF snippet in a branch

    The developer creates a branch for each extension and adds the CSRF token field to every form in the register, using the snippet and form pattern documented for CKAN 2.12. Any use of ignore_extensions is removed and the template path is checked against the 2.12 template structure. Where a form posts through JavaScript, the token is sent with the request. The output is a reviewed branch per extension. You know this step is done when the register shows each form marked as changed and the code review confirms no form is left without the token.

  3. Deploy to a CKAN 2.12 test environment

    The platform team builds a test environment that matches production in CKAN version, Python version, extension versions and configuration, using a recent copy of the production database and a restored backup. The patched extensions are installed and the CKAN service is restarted with the same plugin list as production. The output is a running test portal on CKAN 2.12 with the branches deployed. You know this step is done when the portal starts without errors in the logs and the front page loads for both anonymous and logged-in users.

  4. Run form-by-form test cases

    The QA lead works through the register one form at a time. For each form, the tester checks that it renders, submits successfully with valid data, and saves the expected result. The tester also submits with a missing or expired token and confirms CKAN rejects the request, then submits invalid data to confirm the form redisplays the errors and keeps the values entered. Error-path cases include validation failures on required fields and submissions from a session that has timed out. The output is a signed test log with pass or fail per case. You know this step is done when every form has passed all cases or has a logged defect assigned to the developer.

  5. Confirm extension versions against CKAN 2.12

    The platform team checks each extension's repository for a release or branch that declares support for CKAN 2.12, and records the exact version pinned in the test environment. Any extension without a 2.12 release is flagged for a decision: patch it, replace it, or hold the upgrade. The version list is compared with the production requirements file so nothing changes between test and production. The output is a version table signed off by the platform owner. You know this step is done when every installed extension has a version recorded against a stated CKAN 2.12 compatibility source.

  6. Schedule the production cutover

    The change owner agrees a cutover date and window with the business owners of the portal, and confirms who can approve a rollback during the window. The runbook lists the order of actions: announce the window, take a fresh backup of the database and file storage, put the portal into maintenance mode if your setup allows it, deploy the extension versions from the signed table, run the CKAN upgrade steps, and then restart services. The output is an approved change record and runbook. You know this step is done when the approvers have signed the change record and the runbook has been walked through once in the test environment.

  7. Define the rollback point and restore path

    Before the cutover begins, the platform team records the previous CKAN release, the previous extension versions and the location of the verified backup taken in the previous step. The rollback procedure is written as a sequence: stop services, restore the database and file storage from that backup, reinstall the previous extension versions, and restart on the previous CKAN release. The team rehearses the restore in the test environment and times the steps against the change window. The output is a rollback record that anyone on call can follow. You know this step is done when a restore from the backup has been completed successfully in the test environment and the portal returns to its prior state.

  8. Verify forms after cutover

    After the production cutover, the QA lead repeats a short set of checks on the live portal: every form in the register is loaded, one valid submission is made, and one submission with a missing token is confirmed as rejected. Application logs are watched for CSRF errors and template errors for an agreed period after the cutover. The output is a post-cutover check record that lists each form and its result. You know this step is done when every form passes the checks and the logs show no new form-related errors, at which point the rollback point can be closed.

How form fixes move from inventory to production

The path starts with an inventory of every form that posts data, including templates copied from core and forms supplied by extensions. Each form is classified as custom or extension-provided, because that decides who owns the fix: your team edits custom templates directly, while extension-provided forms need either an upstream release that already carries the token or a local override. Every changed form is then tested on CKAN 2.12 in a staging copy, and only a passing result moves to production. A failed test returns to the backup taken before the change, so the rollback point is decided before any template is edited.

Decision path from form inventory to production or rollback.

Choosing between patching templates, upgrading extensions and replacing them

When the form is part of your portal's own theme or custom templates, you own the fix. The change is usually to add the CSRF token snippet to each form template that posts data and to confirm that the form's submit path still reaches the handler it expects. Because the code is yours, the work is bounded by the number of templates and the amount of testing you run, not by a third party's release schedule.

  • Inventory every POST form: search your theme for form tags with method post and for any custom views that accept form data, since missed forms show up only when users submit them.
  • Add the token snippet: include the CSRF field inside each form, following the pattern in the CKAN 2.12 template changes, and keep the snippet identical across templates so it is easy to review.
  • Test state-changing actions: exercise create, edit, delete and bulk actions as a logged-in user, not just page rendering, because a missing token fails only on submit.
  • Track the change in version control: keep the template patch in your theme repository so the next patch release does not silently overwrite it.
  • Plan for template drift: each upgrade may restructure the base templates you extended, so a patch that works today may need rework later.

Before you close this route, confirm that every form the theme touches passes a submit test in a staging copy of the portal.

Failure modes that show up after the change

Most CSRF upgrade failures do not show up as errors during the change. They appear later, in forms that look fine, in code paths nobody inventoried, or when a rollback meets a database that the old release cannot read. Each card below names one of these failure modes and the check that catches it before users do.

Forms that submit silently

A form that renders without the CSRF snippet may still display normally, then fail on submit when the token is missing or stale. The user sees the page reload or return to the same form with no clear message, so the failure can pass testing that only checks rendering. For each changed form, submit it as a logged-in user in a staging copy, confirm the record was saved, and check the server log for CSRF rejections. Test the submit, not the page load.

CKAN release policy

Leftover ignore_extensions references

The ignore_extensions option is gone in CKAN 2.12, but it can still appear in extension code, template overrides, or the deployment's config files that were copied from older projects. Code that still passes it may fail at load time, or the option may be silently ignored, leaving behavior different from what the team expects. Search every extension repository and the deployment configuration for the key, and confirm that each extension's own CKAN version table includes 2.12 before you rely on it.

AJAX and API forms missed

Forms that submit through JavaScript, fetch calls, or custom API-driven widgets often live in static assets or partials that an inventory of .html templates will not find. These can break in production while every server-rendered form passes review. Build the inventory from the browser side too: list every JavaScript file that posts to a CKAN route, and exercise each widget in a test session. Any request that returns a token error belongs on the list for a CSRF fix.

Rollback blocked by schema changes

Once the upgrade runs database migrations, the previous CKAN release may not read the new schema, so reverting the code alone is not a safe rollback. Teams that did not take a database backup before the migration, or that tested rollback only on code, find they cannot return to the old version without restoring from backup and losing data entered since the change. Before the upgrade, take a verified database backup, record the migration state, and rehearse the restore in a separate environment.

What makes extension form fixes take longer

This table lists the factors that stretch CSRF fixes for CKAN 2.12 extension forms and what each one does to effort. Read each row as a question to answer about your own portal before requesting a quote, since the rows that score highest are the ones that multiply the work.

DriverEffect on effortHow to reduce it
Number of custom formsEach form needs its token snippet checked, its POST handling confirmed and a submission test, so effort grows roughly with the countInventory every template with a form tag and sort them into simple, multi-step and permission-sensitive groups
Third-party extensions with formsForms in extensions you did not write may need upstream fixes or version changes before your own templates can be correctedList each extension and its supported CKAN versions, and confirm which ones already ship CSRF-aware templates
Heavy customization of core templatesForks of core form templates drift from upstream, so each fork must be merged against the 2.12 version by handOverride the smallest block possible and record which core template each override came from
JavaScript that posts dataRequests made by scripts outside a form tag can miss the token, so every fetch and AJAX call needs review in addition to templatesSearch front-end assets for POST and fetch calls and route them through one shared helper that sends the token
Number of environmentsEach environment needs its own build, configuration check and smoke test, and drift between them causes repeat workKeep one tested configuration in version control and promote the same build through development, staging and production
Permission-sensitive formsForms that change roles, organization membership, sysadmin status or API tokens need negative tests for each user type, which takes the most timeWrite a test matrix of roles and actions before coding, and ask the vendor to show evidence for each permission path

Questions buyers ask about CKAN 2.12 form fixes

How much effort does fixing extension forms for CKAN 2.12 take?

Effort depends mainly on how many forms your extensions and custom templates define and how much each one changes. A portal with a few forms that post to standard CKAN actions needs a small change, while a portal with many custom dataset, organization and admin forms needs a form-by-form review. Each form needs the CSRF snippet added to its template, a check that the submit path accepts the token, and tests for a valid submission and a submission without one. Extensions that override core templates or depend on the removed ignore_extensions option add tracing work. Cost splits into internal staff time or a partner's fixed-scope fee, both mostly one-time, with recurring effort only when new forms are added. Ask any quote to list each form, each extension and the test cases per form.

How long does a CKAN 2.12 form fix usually take?

No researched figure sets a standard duration, so timing depends on the number of forms, the state of your test environment and how many people must approve each form's behavior. The work usually runs in order: inventory the forms, fix them in a development copy, test each one, then promote the change through staging to production. Extensions that override core templates add time because each override must be traced first. Waiting for a release window, a review of changed forms or a response from an extension maintainer often takes longer than the code change. Ask for a timeline built from a written list of forms and environments, with a date for the staging test. Check the CKAN releases page for the exact 2.12 release notes before you plan the window.

What does our team need to provide for a CKAN form fix?

Your team needs to supply access, data and owners before the work starts. The list below covers the core inputs:

  • Read and write access to the code of each custom extension and template, plus a non-production CKAN 2.12 instance
  • An inventory of installed extensions with their current versions
  • Test data: sample datasets, organizations and user accounts for each role that uses a form
  • A named owner for each form who can confirm the expected behavior after the fix
  • Access to deploy to staging and an agreed change window for production

Missing owners cause the most delay, because a form cannot be signed off if no one can say what it should do. Provide these items in writing so the scope and quote match what your environment actually contains.

Can our internal team fix CKAN 2.12 extension forms without a partner?

Yes, if the team knows CKAN templates, Flask and Jinja and can run a staging copy of the portal. The CSRF change is a template and form-handling change, so engineers who maintain the extension code can usually make it. The gaps tend to be ownership and testing: nobody may own a third-party extension, an extension may have stopped at an older release, and each changed form needs a test as every relevant role. Start with one form as a pilot, record the steps, and use that record for the rest. Internal teams that cannot dedicate time to testing across roles often choose a partner for that part only, and the decision should follow from your staff's availability and skills.

What does a fixed-scope engagement cover for CKAN form fixes?

A fixed-scope engagement covers the work listed in a written scope agreed before the work starts. DeployOpen works in your own infrastructure, so the scope names the environments, the forms and extensions in scope, and the deliverables. A typical scope includes an inventory of custom forms and extensions, the CSRF change for each in-scope form, testing in your staging environment, handover notes, and documentation of what changed. Timelines and deliverables are fixed in that document. Ongoing support, upgrades and continuous testing are available as retainers after the fix. DeployOpen does not publish a price list, so a quote follows from the written scope, and anything outside it needs a change to that scope.

What breaks if we skip the CSRF change on CKAN 2.12?

Forms that lack the CSRF token can fail when a user submits them, so users see errors on save, search or edit actions instead of a completed change. The failure is not always visible during a quick check. A form may still render while failing for one role or one action, and a form that depends on the removed ignore_extensions option may stop loading or behave differently after the upgrade. Treat the exact failure modes as something to confirm in your environment and in the 2.12 release notes, not as a fixed list. Any form that accepts input from users is worth checking first, because those are the ones where a silent failure is most likely to reach production.

How do we check that a CKAN form fix works?

Check each form in the staging environment with a fixed set of steps. First, load the page and confirm the CSRF field is present in the rendered HTML. Second, submit a valid form as each relevant role and confirm the change saves. Third, submit the same form without the token and confirm the request is rejected, not accepted. Fourth, review your configuration for any remaining ignore_extensions setting and remove it where it is no longer used. Record the results per form, with the role, the test data and the outcome, so a reviewer can trace each check. Repeat the same tests after each patch or minor upgrade, because a later change to an extension or template can reintroduce the problem.

How DeployOpen works on this

DeployOpen starts by inventorying every custom template, form and extension view that a CKAN 2.12 upgrade touches, then fixes CSRF handling and the removed ignore_extensions option in a separate environment before anything reaches production. Each engagement is delivered against a written scope with named deliverables and a handover your team can run.

How we scope

  • Inventory every custom template, extension form and POST handler that depends on the CSRF snippet and the removed ignore_extensions option.
  • Confirm the target CKAN version, the extensions in use and the environments that need the fix, such as staging and production.
  • Agree the scope, deliverables and timeline in writing before work starts, since most engagements are fixed-scope.

How we build

  • Add the required CSRF token to each affected form and check that the token is rendered and accepted on submit.
  • Replace the ignore_extensions handling with the supported approach for each extension, and test the change on the target 2.12 build.
  • Test each fixed form for successful submission, rejected requests without a valid token and unchanged behavior for logged-in users.

How we hand over

  • Deliver the patched templates and extension code with a change log that maps each fix to the form or view it touches.
  • Document the CSRF pattern used so your developers can apply it to new forms without repeating the investigation.
  • Walk your engineers through the test results and the remaining items you should confirm in your own environment.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer once the fixes are in production.
  • Re-run the form tests when you apply later CKAN patch or minor releases, so regressions are caught before they reach users.
  • Confirm with your team who owns extension updates and form changes after handover, and record that owner in the runbook.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.