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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | type_error-3239400-2.patch | 533 bytes | kunalkursija |
Issue fork scheduled_transitions-3239400
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
Comment #2
kunalkursija commentedHere is the patch which calls
invalidateTagsonly after it has been defined.Comment #3
kunalkursija commentedupdating issue summary.
Comment #4
kunalkursija commentedComment #6
dpiComment #10
dpiMerged 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.