Problem/Motivation
TypeError: Argument 1 passed to Drupal\date_recur\Plugin\DateRecurOccurrenceHandler\DefaultDateRecurOccurrenceHandler::getOccurrenceCacheStorageTableName() must implement interface Drupal\Core\Field\FieldDefinitionInterface, instance of Drupal\field\Entity\FieldStorageConfig given, called in modules/contrib/date_recur/src/Plugin/DateRecurOccurrenceHandler/DefaultDateRecurOccurrenceHandler.php on line 106 in modules/contrib/date_recur/src/Plugin/DateRecurOccurrenceHandler/DefaultDateRecurOccurrenceHandler.php on line 229 #0 web/modules/contrib/date_recur/src/Plugin/DateRecurOccurrenceHandler/DefaultDateRecurOccurrenceHandler.php(106): Drupal\date_recur\Plugin\DateRecurOccurrenceHandler\DefaultDateRecurOccurrenceHandler::getOccurrenceCacheStorageTableName(Object(Drupal\field\Entity\FieldStorageConfig))
Proposed resolution
Get the storage definition instead of the field in all calls to getOccurrenceCacheStorageTableName()
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2990639-2.patch | 3 KB | joelpittet |
Comments
Comment #2
joelpittetHere's the patch
Comment #3
joelpittetPrevents delete so bumping to major.
Comment #5
dpiThanks, committed with minor additions.
Changes were already on 8.x-2.x
Comment #6
joelpittetThanks! maybe I should be on the 2.x branch, didn't realize there was a new branch in the composer workflow(still getting used to it).
Comment #7
joelpittetMay I ask why the other occurrences I replaced didn't need the same treatment?Edit: Just found the answer, the variable is the same name but the value is different... it's the field storage definition... Maybe I could propose a variable name change for consistency?