Problem/Motivation

When adding/updating a field with unique field enabled an error is thrown upon saving.

The website encountered an unexpected error. Please try again later.
TypeError: Argument 4 passed to unique_field_ajax_is_unique() must be of the type string, null given, called in /public_html/modules/contrib/unique_field_ajax/unique_field_ajax.module on line 495 in unique_field_ajax_is_unique() (line 528 of modules/contrib/unique_field_ajax/unique_field_ajax.module).

Steps to reproduce

  • Add a new field
  • Enable unique
  • Save the field

Proposed resolution

Make sure that argument 4 allows null being passed in.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

    Comments

    Eli.Stone created an issue. See original summary.

    3li’s picture

    Adding patch that resolves issue, caused by method expecting a string but can get NULL.

    • Eli.Stone committed 13d30d2 on 2.x
      Issue #3239801 by Eli.Stone: Argument 4 passed to...
    3li’s picture

    Status: Active » Fixed

    Status: Fixed » Closed (fixed)

    Automatically closed - issue fixed for 2 weeks with no activity.