Problem/Motivation

TypeError: Argument 1 passed to Drupal\Core\Cache\Cache::invalidateTags() must be of the type array, null given, called in /Users/XXXX/Sites/html/XXXX/web/modules/contrib/scheduled_transitions/src/Entity/ScheduledTransition.php on line 318 in Drupal\Core\Cache\Cache::invalidateTags() (line 147 of /Users/XXXX/Sites/html/XXXX/web/core/lib/Drupal/Core/Cache/Cache.php).

Steps to reproduce

I wrote a custom migration that involved dealing with creating scheduled_transitions entities. On running the migration, I am facing the fatal error mentioned above.

Proposed resolution

On checking the code, I found that variable passed to the invalidateTags function is not defined in ScheduledTransition.php and hence NULL is being passed.

Remaining tasks

Call invalidateTags only when $tags holds value.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

CommentFileSizeAuthor
#2 type_error-3239400-2.patch533 byteskunalkursija
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

kunalkursija created an issue. See original summary.

kunalkursija’s picture

StatusFileSize
new533 bytes

Here is the patch which calls invalidateTags only after it has been defined.

kunalkursija’s picture

Issue summary: View changes

updating issue summary.

kunalkursija’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: type_error-3239400-2.patch, failed testing. View results

dpi’s picture

Version: 2.x-dev » 2.2.x-dev

  • dpi committed 3634928 on 2.2.x
    Issue #3239400 by kunalkursija: TypeError: Argument 1 passed to Cache::...

  • dpi committed 8eca188 on 2.3.x
    Issue #3239400 by kunalkursija: TypeError: Argument 1 passed to Cache::...
dpi’s picture

Status: Needs work » Fixed

Merged to 2.2.x and 2.3.x.

Changes will be available in 2.2.1 and 2.3.0-beta3 when they are released in the future.

Status: Fixed » Closed (fixed)

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