Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Field Is Empty

Security covered Under active development

This module provides a computed field that indicates whether another field on an entity is empty or not. It outputs a true or false value that can be optionally inverted, and is useful for tasks like search indexing or exposing field emptiness via APIs.

Provides a computed field type whose value depends on whether another field is empty or not. It presents a TRUE or FALSE result, which can optionally be set inverted.

Some use cases

  • Search API indexing.
  • Exposing empty/non-empty information about private fields through REST/JSON:API.
  • Your very special case.

How to use it

Just like any other field module

A Field Is Empty field can be added and configured through the admin UI in the usual way. Its value will be recalculated whenever the parent entity is saved, and stored in the database.

As a computed base field

A field can be added programmatically to any entity type. This approach makes it a base field, available on all bundles of the entity type. See the example included in the project package.

As a computed bundle field

It is also possible to add a field programmatically to an entity bundle. This approach requires #2986836 to be merged or a patch applied (tested with this one). See the example that will be included in the project package once the core issue is closed.

Related core issues

Drupal 8–11

Ask your assistant about Field Is Empty

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • field Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Apr 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.1 Stable 8–11 Apr 14, 2024