Install

Works with Drupal: ^11.4 || ^12

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 944.74 KB
MD5: 40ca151976f4dfae4374f5c8808b670b
SHA-1: 83119a595dd9061282a7e4336bc9d2e102641ce4
SHA-256: 13ad7d8b2fc5e45658f6971a02c9ce86daff5accc936f576462b20ff54caa059
Download zip 1.45 MB
MD5: 6d4b2c70b82d944ca1142d191d5bf036
SHA-1: b84f2ff1a05626b7b8116374151b4383e68a3bcd
SHA-256: 3abcf8c7a759a8dca714de592a7ea007eb53f9d38d7fc22109d0a30b7bfe4231

Release notes

This release represents 100s of hours of work by Skvare developers. The goal was complete modernization in both Drupal and CiviCRM.

I recommend using this release for new Drupal 11.4+ or 12 sites, and using the API4 backend. API3 and Auto Compatibility modes are intended to ease upgrades for existing sites. Many sites likely could convert to 5.0.x and API4 immediately, but you should test and check all your CiviCRM related Drupal configuration. API4 getFields() can produce different base field names and a couple of entity types don't exist in API4.

During development of this release we discovered a couple of CiviCRM core bugs in civicrm-drupal-8. These were merged and should be in 6.21 or 6.22. I recommend using Drupal 12 with that version of CiviCRM or higher.

Extensive testing was done with Drupal 11.4 and CiviCRM 6.16.5. That ESR version should be considered the minimum to run CiviCRM Entity 5.0.0, although older versions could work.

The test suite patches Drupal Core with https://git.drupalcode.org/project/civicrm_entity/-/blob/5.0.x/.gitlab-c...
This should not be necessary for your site except to run the tests, or in a case where you install both the User module and CiviCRM at the same time.

For the same issue there is an MR for civicrm-drupal-8 https://github.com/civicrm/civicrm-drupal-8/pull/134

Overview

5.0.0-alpha1 is the first release on the 5.0.x branch: CiviCRM Entity for Drupal 11.4 and Drupal 12, rebuilt so that it can run on CiviCRM API4 as well as API3. It is an alpha. Test it on a copy of your site, not in production.

The headline changes:

  • A selectable API backend. auto, api3 or api4_native. New installs start on api4_native; sites upgraded from 4.0.x stay on api3 until an administrator switches.
  • API4 native mode. Drupal sees CiviCRM's own API4 field names and types, with no API3 in the path.
  • Drush tooling to audit routing, compare backends on real data, and rewrite configuration when switching backends.
  • Contributed-module integrations moved to submodules. Views Bulk Operations, Rules, Search API, Field Group and Display Suite support now install separately.
  • Drupal 12 readiness. Return types, signatures and hooks updated for Drupal 12 and PHP 8.5.

Requirements

Drupal 11.4 or 12 and CiviCRM 6.16.5 or later.

Component Requirement Notes
Drupal core ^11.4 || ^12 Raised from 4.0.x's Drupal 10/11 support.
PHP 8.3 or later The module uses typed class constants.
CiviCRM 6.16.5 or later recommended Upgrade-tested on 6.16.5. Developed and tested on 6.19 through 6.21.alpha1. Pin civicrm/civicrm-core, civicrm/civicrm-packages and civicrm/civicrm-drupal-8 to versioned constraints in your project composer.json.
Optional integrations views_bulk_operations, rules + typed_data, search_api, field_group, ds Each one is needed only by its matching submodule. At the time of writing, most of these have no Drupal 12 release yet.

New features

Selectable API backend

A new API backend setting (Structure › CiviCRM Entity › Settings › Advanced settings, config key civicrm_entity.settings:api_backend) chooses which CiviCRM API runs each operation, and which field names Drupal sees.

Mode Runs operations through Drupal field names Default for
api4_native API4 only, routed by live API4 discovery API4's own names and types, from getFields New installations
auto API4 where the operation is certified, API3 otherwise, chosen before execution from a checked-in compatibility matrix Unchanged from 4.0.x —
api3 The API3 compatibility client Unchanged from 4.0.x Sites upgraded from 4.0.x

auto and api3 keep every existing entity type ID and base-field name, so you can move between them freely. On the reference site, 50 of the 53 entity types are API4-backed; 3 remain API3-only. An operation that has started on API4 is never retried on API3.

API4 native mode

api4_native presents CiviCRM through API4 on its own terms. Switching into or out of it changes the entity schema, so on an existing site it is a deliberate migration, not a routine setting.

  • Contribution's contribution_source becomes source.
  • API3-only fields go away, for example Contribution soft_credit_to, note and batch_id, Contact current_employer, and Address world_region.
  • API4 fields the module never exposed appear, such as Contact's primary and billing address, email and phone.
  • List-serialized fields become multi-value Drupal fields.
  • Custom fields keep their custom_N names.

Records of multi-record custom groups

In auto and api4_native, each active multi-record custom group gets a Drupal entity type for its records, named civicrm_cv_ plus the group's name in lowercase. A long name is shortened and ends in a hash. A group extending contacts, for example, gives civicrm_cv_volunteer_history.

  • Fields. Each record type has id, entity_id (the record's contact, or other parent) and the group's fields, under their usual custom_N names.
  • Pages. A record type is enabled, and offers pages, exactly when the type its group extends does, following that type's page settings.
    • The parent's page gets an "Add" action for each group.
    • The add form fixes the parent, and so does the edit form.
    • Saving or deleting returns to the parent.
  • Access. Viewing a record needs view access to its parent. Changing one needs update access to it. In both cases the group must also be open to the user: through access all custom data or administer CiviCRM data, or a CiviCRM ACL granting the group to their contact.
  • Displays. Until a site builder configures a record type, its page and form show every field with its type's default widget and formatter, each with its label above it. References show as links and are entered through an autocomplete, Money and decimal fields as numbers, booleans as Yes or No, and options by their labels. CiviCRM's Radio and CheckBox fields get radios or checkboxes. The record list shows the same rendered values, and leaves out a field the user may not view.
  • Validation. A record is refused for a parent of a contact type or sub-type the group does not extend, or one that already has the group's maximum number of records. A record cannot be moved to another parent.
  • Views. Each record type is a Views base table, with a relationship to its parent and a reverse relationship from the parent. Views built on 4.0.x keep working: the group's civicrm_value_* table is described as before.
  • Search API. With civicrm_entity_search_api, an index can include a record type. Changing, adding or deleting a record queues its parent for reindexing, so the parent's indexed lists of the group's values stay current.
  • Hooks. Drupal's entity hooks fire once for records written in Drupal, and for those written in CiviCRM through API3, API4 or its own screens. A delete made in CiviCRM's screens fires no predelete, because CiviCRM reports it only after the row is gone. The parent's hook switch applies to its records.
  • Lifecycle. Record types follow CiviCRM's groups at the next cache rebuild, which installs new ones and removes vanished ones. This includes groups changed in the database directly, for example by a restore: the rebuild flushes CiviCRM's metadata cache first. Until then, the pages of a type whose group has gone are not found, and the parent no longer offers its "Add" action. Removal never drops or alters a CiviCRM table. Configuration naming a vanished type is kept and listed on the status report.
  • Audit. drush civicrm-entity:api-audit lists the record types.

The entity's own custom_N fields for a multi-record group remain read-only lists of every record's value; see Known issues.

Drush commands

Four new commands support the migration:

  • civicrm-entity:api-audit reports routing and drift. It can also record a reviewed base-field baseline and install missing entity types.
  • civicrm-entity:config-rewrite rewrites displays, Views, base field overrides and Search API indexes after a backend switch. It snapshots configuration first, and the snapshot can be restored.
  • civicrm-entity:parity compares reads and rolled-back writes across backends, and can act as a release gate against a coverage contract.
  • civicrm-entity:generate-manifest regenerates the fallback base-field manifest. It is a maintainer tool.

Validation without API3

API4 has no validate action. CiviCRM Entity now ships its own layered validator, which checks CiviCRM metadata and entity-specific rules, then runs a non-persisting API4 validation probe. CiviCrmApi::validate() keeps its existing response shape. Entity validation reports errors as Drupal constraint violations.

API4 write adapters

Generic API4 create and update lack some API3 behaviour, such as derived dates, name-to-ID resolution and optimistic locking. Sixteen write adapters reproduce it for Contact, Address, Activity, Case, Contribution, Membership, Participant, Pledge and others. A module exposing a CiviCRM extension's entity can add its own adapter by implementing Api4WriteAdapterInterface.

Cache invalidation from CiviCRM

CiviCRM writes, merges and custom-field changes now invalidate the Drupal cache tags of the affected entity and of entities that reference it. Field metadata and option lists are cached and dropped when the backend or the CiviCRM metadata changes. A CiviCRM cache clear also refreshes CiviCRM Entity's metadata, Drupal's entity types, field definitions and Views data, on every supported CiviCRM version. That covers Cleanup caches and extension changes, which needed a Drupal cache rebuild in 4.0.x.

Smaller additions

  • Status report: shows the active backend and suggests integration submodules whose dependencies are installed. It warns when configuration needs civicrm_entity_bundles but that module is disabled.
  • Layout Builder: bundle displays from civicrm_entity_bundles can use Layout Builder through the generic-bundle display.

Technical changes

All CiviCRM access now goes through one gateway service, which picks a backend per operation. Most of the other changes follow from that.

API layer

  • Gateway and clients. CiviEntityApiGateway routes every read and write to Api3EntityClient or Api4EntityClient. CiviEntityCapabilityRegistry holds the checked-in compatibility matrix that auto uses. Entity storage and entity queries use the gateway. The public civicrm_entity.api service (CiviCrmApi) keeps its methods.
  • Metadata normalization. Api4MetadataNormalizer and CiviEntityFieldMapper turn API4 metadata and results into the API3-compatible shape for auto and api3, and accept historical API3 input spellings as aliases.
  • Normalized failures. Backend errors throw CiviEntityApiException. A storage failure now raises EntityStorageException instead of looking like a missing entity.

Entity types and fields

  • Registered regardless of component. An entity type is defined for every CiviCRM entity the module knows, even if its component or extension is disabled. A disabled one reports its operations as unsupported instead of disappearing, so its displays and Views keep their schema. Post-update 5000 installs any types Drupal has not recorded.
  • Fallback manifest. CiviEntitySchemaManifest supplies base-field shapes when no live API can describe an entity. It also holds the API3-era names that the audit and the alias map use.
  • Serialized fields. API4 arrays convert back to API3 strings in auto and api3. In api4_native, list-serialized fields are multi-value and associative ones keep a reversible scalar form.

Submodules

Code that depended on contributed modules now lives in submodules, so the base module installs without them. None are enabled automatically.

Submodule Provides Requires
civicrm_entity_bundles Bundles from CiviCRM option lists (for example Activity and Event types), Field UI, Layout Builder —
civicrm_entity_vbo Views Bulk Operations actions views_bulk_operations
civicrm_entity_rules Rules actions, conditions and data filters rules, typed_data
civicrm_entity_search_api Search API datasource search_api
civicrm_entity_field_group Field Group bundle support field_group
civicrm_entity_ds Display Suite bundle settings ds

Drupal 12 and code modernization

  • Return types and method signatures updated for Drupal 12 and PHP 8.5, for example EntityListBuilder operations and loadFromDedicatedTables().
  • Hook implementations are moving into attribute-based Hook classes (EntityHooks, ViewsHooks, CacheHooks, RequirementsHooks, QueryHooks, ThemeHooks, FieldWidgetHooks). civicrm_entity.views.inc is gone.
  • Services use constructor promotion and autowiring.

Fixes

  • Proximity filters, distance fields and sorts no longer drop contacts at exactly the searched coordinates.
  • A nested entity-type build triggered while CiviCRM is booting is skipped, instead of calling a half-initialized CiviCRM.
  • Contact checksum access now varies its cache by cid1 and cs.
  • Saving an entity no longer moves its date-only fields back a day on sites west of UTC. A date such as a contact's birth date was converted into the site timezone on the way to CiviCRM, so 1990-05-15 was sent as 1990-05-14 18:00:00 in America/Denver and every save moved it a day earlier. This affects every backend mode, and 4.0.x had the same behaviour. Date-and-time fields are still converted. Sites west of UTC that saved entities through Drupal may already hold shifted dates; this release does not repair them.
  • Emptying a field and saving now clears it in CiviCRM, in every backend mode.
    • Before: an empty field was left out of the save, so CiviCRM kept the old value. That covered emptying a text, number or date field, unchecking every checkbox, and deselecting every option of a multi-select, through forms and through the entity API. 4.0.x has the same behaviour.
    • What is cleared: a field emptied since the entity was loaded. A field that was already empty, and every field of a new entity, is still left out.
    • What is kept:
      • An entity built in code with an existing ID, rather than loaded, still updates only the fields it holds.
      • A value the edit form could not show is not cleared, such as an option the field no longer offers, or a reference to a contact the user may not see.
      • In api3, multi-value Country and State/Province custom fields keep their values: API3 cannot clear them.
  • A save or delete made through Drupal now fires Drupal's entity hooks once.
    • Before: CiviCRM reports each write back through its own hooks, and CiviCRM Entity forwarded that report as a second presave and insert or update, on a freshly loaded copy. This happened on every create and every update. A delete fired twice when the entity had been saved earlier in the same request, and deleting a contact added a stray presave (plus an update in api3). 4.0.x has the same code path.
    • Still forwarded: writes CiviCRM makes on its own, including any it makes inside Drupal's write, such as an individual's new employer organization.
    • Hook values: the entity passed to insert and update hooks now carries the values CiviCRM computed during the save, such as a contact's display name. Before, only the second, forwarded call had them.
    • If your code relied on the second call: it now runs once.
  • Entity queries that check access, which is the default, now find only entities the current user may view.
    • This applies to entity reference autocomplete and validation, options widgets and entity listings.
    • The rule is the entity type's view permission, or for records of a multi-record group, the parent's view permission and the group's own rule.
    • Code that validates references to CiviCRM entities from drush or cron runs as anonymous. It must switch to a user who may view them, or not validate.
  • With Check permissions on:
    • CiviCRM's answers for one user are no longer cached for others. Entity queries and the persistent entity cache are skipped, and rendered CiviCRM entities vary by user.
    • A read CiviCRM refuses is treated as no entity: the page is not found or forbidden, instead of failing with an error, and nothing is logged.
    • Saving custom data no longer fails for users CiviCRM does not let read the custom group.
  • A View on a CiviCRM table no longer fails when a row's related entity cannot be loaded.
  • In auto and api4_native, custom fields follow CiviCRM's access rule for their custom group: "access all custom data", or an ACL granting the group.
    • This covers single-record fields, the lists of a multi-record group's values, and a record's own fields.
    • Users without that access do not see the values on displays, in forms, or in Views columns of these fields.
    • api3 keeps 4.0.x behaviour, where a custom field is as visible as its entity.
    • CiviCRM's install grants "access all custom data" to anonymous and authenticated users, so most sites see no change.
  • A record's add form opens only for users who may update its parent's type (for example "edit all contacts") and edit its custom group.
  • Views filters on custom fields in a custom group's table (civicrm_value_*) now offer "Is empty (NULL)" and "Is not empty (NOT NULL)".
    • Before: only Contact Reference and Boolean filters offered them, unless the View had a relationship. An empty operator saved in configuration added no condition, so the View listed every row. 4.0.x has the same behaviour.
    • If a View saved one of these operators: it now filters by it.
  • Views filters "Is one of" and "Is none of" on multi-select, multi-country and multi-state custom fields now match each value a contact holds.
    • Before: they matched only contacts holding the chosen value alone, and "Is none of" kept contacts holding it among others. Since 5.27, CiviCRM stores these fields as Select fields that allow several values, and the filter recognised only the older field types. Checkbox fields were not affected. 4.0.x has the same behaviour.
  • Fields CiviCRM keeps as a list in one column have Views handlers again in api4_native, and a record type's list fields have them in auto and api4_native.
    • Which fields: in api4_native, every multi-value core field stored in its entity's table, such as a contact's subtypes and preferred communication methods, a participant's roles and fee levels, a group's types, parents and children, and a tag's "used for"; on a record type, its checkbox and multi-select fields.
    • Before: these fields had no Views handlers, so a View built on them in another mode had broken handlers after a switch to api4_native, and a record type's list fields could not be added to a View at all.
    • Display: every value in one row. A row per value, click sorting and aggregation are not available on these fields.
    • Filter: "Is one of", "Is all of", "Is none of", "Is empty" and "Is not empty". A field without an option list takes a typed value. Views saved with core's list or string filter on these fields keep working.
  • Contextual filters on multi-value custom fields, and on contacts' subtypes, match each value a row holds. Before, they matched only rows holding that one value. 4.0.x has the same behaviour.
  • In auto, an Autocomplete-Select custom field with an option list offers its options again, so its form shows the stored value and emptying it clears it. API4 loads no options for such a field; they now come from the field's option group, active values in their order, as in API3.
  • With civicrm_entity_bundles, entity queries on the bundle of an event or an activity work, in every backend mode.
    • Before: in auto and api4_native, CiviCRM refused the condition ("Invalid field 'bundle'"). In api3 it ignored it, so every row matched. 4.0.x has the same behaviour.
    • What this fixes: an entity reference field limited to some event or activity bundles, loadByProperties() with a bundle, and a Search API datasource limited to some bundles ("Unknown column 'bundle'").
  • With civicrm_entity_bundles, an event or activity form follows its form mode: the root bundle's display for that mode, or its default display. Before, it always used the default display. 4.0.x has the same behaviour.
  • Rules:
    • "Create linked drupal user account" provides civicrm_user again. Before, Rules threw an error after the user was created and linked, so "Instant signin" and "Send account notification email" never ran.
    • The username data filters (FirstLast, firstdotlast, initialdotlast) apply to contacts again on Drupal 11.4. Before, they never applied.
  • Views Bulk Operations: a failed "Add Contact to Group" is logged and shown as an error. Before, it failed silently.
  • Search API's "Track changes in referenced entities" now works for CiviCRM entities, in every backend mode.
    • Before: changing an entity did not queue the items that index its values through a reference, such as activities that index their source contact's name. In auto and api4_native, Search API logged an error on each such save. In api3, CiviCRM ignored the condition, so the first 25 items of the type were queued instead. 4.0.x has the same behaviour.
    • A reference to a reference, such as an activity's source contact's employer, is still not followed.
  • A new form display sizes long text fields' text areas to CiviCRM's row counts, such as 8 for an activity's details, in every backend mode. A TextArea custom field takes its number of rows too, in api4_native and on a record type in every mode.
    • Before: the count was stored beside the widget's settings, where no widget read it, so every text area had 5 rows. 4.0.x has the same behaviour.
    • CiviCRM Entity's text area widget and its contact reference and multiple value formatters now have a configuration schema for their settings. A form display built from the field defaults failed Drupal's schema check.
    • Saved form displays keep their row counts. Post-update 5004 removes the misplaced value from them.
  • On Drupal 12, installing a site whose modules include civicrm_entity_bundles no longer fails while installing the themes. The module's install hook rebuilt Drupal's container, which left Drupal 12's installer without its module list. It now flushes the caches without the rebuild, which the module installer has already done.
  • On Drupal 12, Views filters on an address's state or province now work. Before, creating the filter failed, so any View using it and the Views UI adding it gave an error.
  • The module's Views plugins now have a configuration schema for all their options: custom field and activity end date fields, mailing event fields, distance, the proximity and activity contact record filters, the contact, location, phone, website, relationship and user relationships, the checksum access plugin, the query plugin, and the contact subtype and contact validator options of contextual filters.
    • Before: Drupal's schema check, as in drush config:inspect and module tests, failed for every View using one of them. 4.0.x has the same behaviour.
    • Post-update 5005 saves each View that uses them again, which stores their options with the types the schema declares. Their values do not change.
  • Multi-value filters, in every backend mode, changed in three ways:
    • "Is none of" now lists rows with no value, as Drupal's filter on a multi-value field does. Before, they were left out.
    • "Is empty" also matches an empty list CiviCRM stored as separators alone, which API4 writes for an empty multi-value custom field.
    • A saved operator the filter cannot read now matches nothing and logs a warning, instead of filtering nothing.
  • A Boolean Radio custom field gets Yes and No radios on every entity type, as in CiviCRM, with N/A unless the field is required.
    • Before: it got a checkbox, which submits No when unticked. Saving a form unchanged stored No over an empty value, and could add a row to the custom group's table for an entity that had none. 4.0.x has the same behaviour.
    • Form displays saved with the checkbox keep it, but an unticked box over an empty value now leaves the value empty. A stored value can still be unticked to No.
    • A Toggle field keeps its checkbox, as CiviCRM's own does.
    • In api3, a boolean set to FALSE through the entity API, or an unticked box submitted programmatically, no longer fails validation, and is stored as No instead of emptied.
  • Saving a form no longer removes rich text markup that the text format does not allow.
    • Before: a text editor such as CKEditor 5 drops markup its format does not allow as it loads a value, so a save removed that markup from CiviCRM. Through CiviCRM Entity's own text area widget, the default for rich text fields, a save with no changes did too. With Basic HTML, an event description lost its headings, tables, colours and underlining. 4.0.x has the same widget.
    • Now: a value holding markup its format's editor would remove is edited as HTML, with a note saying so. Other values keep the editor. Display is unchanged.
  • A new site shows rich text from CiviCRM, such as event descriptions, through Basic HTML where that format exists. Before, no text format was set, so the fallback format showed the HTML tags. A site upgraded from 4.0.x keeps its setting; see Upgrading from 4.0.x.
  • A Views relationship to an address, email or phone saved with "Default location" keeps it. Before, re-opening the relationship showed "Any", and applying the form saved "Any". 4.0.x has the same behaviour.

Upgrading from 4.0.x

An upgraded site keeps working on api3 with its existing field names, but you must enable the submodules for any integrations it uses, straight after the update. Without them, upgrade testing on a 4.0.8 site found 24 regressions after drush updb alone.

  1. Back up the Drupal and CiviCRM databases, and export configuration.
  2. Update the code and run drush updb. If CiviCRM's requirements check complains about the site URL, pass -l <site URL>. The updates:
    • update_11001 pins api_backend to api3 if it is not set.
    • Post-update 5000 installs entity types Drupal has not recorded.
    • Post-update 5001 renames Activity's assignee_id and target_id Views filters to assignee_contact_id and target_contact_id.
    • Post-update 5002 records the compatibility audit that auto uses to keep drifting entities on API3.
    • Post-update 5003 lists integration submodules whose dependencies are installed. It does not enable them.
    • Post-update 5004 removes a misplaced rows value from saved CiviCRM form displays, and casts the text area widget's settings to its new schema.
    • Post-update 5005 saves each View that uses the module's Views plugins again, so that their options take the types of the new schema. A View that cannot be saved is named in the update's message.
  3. Enable the submodules you need, for example drush en civicrm_entity_bundles civicrm_entity_search_api civicrm_entity_vbo civicrm_entity_rules. You need civicrm_entity_bundles whenever the site has Activity or Event bundle displays or fields; they do not load without it. Without civicrm_entity_search_api, Search API indexes fall back to core's datasource and query the wrong database.
  4. Replace any Views bundle field, filter or sort on Activity or Event with Activity Type ID or Event Type ID. bundle is no longer a Views handler, because it queried a column CiviCRM does not have.
  5. Run drush civicrm-entity:api-audit --no-fields and check the status report. If it warns that no text format is chosen for CiviCRM Entity, choose one on the settings form: until then, rich text such as event descriptions shows its HTML tags.

Moving to auto or api4_native (optional)

Staying on api3 is supported. To switch:

  1. Change the backend on the settings form, or run drush cset civicrm_entity.settings api_backend api4_native -y && drush cr.
  2. Run drush civicrm-entity:config-rewrite --from=api3 to see what is affected, then the same command with --apply. Note the snapshot ID it prints.
  3. Review the (no counterpart) entries, and any custom code that uses renamed or removed fields.
  4. Re-run the audit, then drush civicrm-entity:api-audit --accept-reviewed-schema to record the reviewed base fields. A site that has already accepted a reviewed schema in auto sees drift on entities with multi-record custom groups after this update, because those fields are now multi-valued and read-only. Accept the schema again.

auto keeps the 4.0.x field names, so step 2 finds nothing to rename. For Views imported from a 4.0.x configuration export after the update, run drush civicrm-entity:config-rewrite --static --apply.

Known issues and limitations

  • Multi-record custom group fields are read-only on the extended entity in auto and api4_native. They list every record's value, in record order, and saving the entity never writes them. Create, edit and delete the records through their own entity types (see Records of multi-record custom groups). api3 keeps 4.0.x's behaviour: one record's value, which a Drupal save writes back as a new record. See multi-record-custom-groups.md.
  • Record types exist in auto and api4_native only. Switching to api3 removes them at the next cache rebuild. Views and displays built on them are kept, listed on the status report, and work again when the site returns to auto or api4_native. While the site is on api3, a View over a record type, or with a relationship to one, fails with an error.
  • Multi-select custom fields keep only their first value when saved in auto and api3. This covers Select fields that allow several values, and multi-select Country and State/Province fields. Checkbox fields keep all their values, and api4_native is not affected. 4.0.x has the same behaviour.
  • In api3, an event's edit form fails to save when a ContactReference custom field holds a contact. API3 returns the contact's name where Drupal expects its ID, and the page reports an unexpected error. auto and api4_native are not affected. Other entity types that return custom data the same way in API3, such as activities, participants and memberships, have not been checked. By code reading, 4.0.x has the same defect.
  • File and Link custom fields. A File custom field is an integer field holding the file's ID, shown as a number and edited with a number widget, and a Link field is plain text. 4.0.x has the same behaviour. Changing them would change installed field types, so they are left for a later release.
  • With Check permissions on:
    • A CiviCRM write by a user CiviCRM does not let read the entity fires no Drupal entity hooks. For example, an anonymous event registration fires no participant insert.
    • Views still list rows of entities CiviCRM refuses to load, with empty values, and log "failed to load an entity" for each.
  • Views do not filter rows by CiviCRM ACLs or record access. As in 4.0.x, a View lists every row its query finds, and restricting it is the site builder's job. The value columns of a custom group the user may not see are left out.
  • A compat → native → compat round trip is not byte-exact. A display saved in native resets the formatter of a renamed component. Search API drops an index field whose property path no longer resolves.
  • Removed fields need a person. config-rewrite reports references with no counterpart in the new backend but never deletes them. Custom code that uses the old field names needs manual updates.
  • Disabled components refuse access. Pledge and Pledge Payment rows no longer render while CiviPledge is disabled, where 4.0.x rendered them through API3.
  • Data is not migrated. config-rewrite covers configuration only. Nothing migrates data stored in Drupal against a renamed base field.
  • Integrations on Drupal 12. Most integration submodules depend on contributed modules that have no Drupal 12 release yet.
  • Pre-existing 4.0.x defects carried over: click-sorting contribution_source or current_employer breaks the query outside api4_native, and the Payment Processor add form cannot be built on CiviCRM 6.16.5.

Testing and verification

This alpha was upgrade-tested from 4.0.8 on CiviCRM 6.16.5. On the API3-compatible backends, all 51 readable entity types matched across backends.

  • In-place upgrade. A Drupal 11.4.5 / CiviCRM 6.16.5 / civicrm_entity 4.0.8 site with a 184-object configuration set was upgraded and moved api3 → auto → api4_native → api3 using the Drush commands. It produced 34 findings (F-UT1 to F-UT34); the user-facing ones still open are under Known issues.
  • Cross-version pass. After updb on 6.16.5, 60 page displays returned HTTP 200, apart from the known click-sort defect and the disabled-Pledge page. In api3 versus auto read parity, auto ran 48 entity types on API4 and 3 on API3, and all 51 readable types matched.
  • Seeded parity. Reads across all 53 entity types, and rolled-back create/update/delete for 23 entity types, were compared across backends on a seeded fixture. The two divergences found were fixed.
  • Automated tests. 94 test classes: 33 unit, 55 kernel and 6 functional JavaScript. They include base-field baselines for CiviCRM 6.16.5, 6.18.1, 6.19.0 and 6.21.alpha1 (a release without its own is compared with the newest before it, and fails only if a base field changed), and a release coverage contract for civicrm-entity:parity.
Created by: markusa
Created on: 18 Oct 2026 at 19:55 UTC
Last updated: 18 Oct 2026 at 20:05 UTC
Bug fixes
New features

Other releases