Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Trying to create a field of type list<text>
, triggers a Unknown field type text. Database search module might be out of sync with Search API.
exception in the database engine.
This is because ->fieldsUpdated()
doesn't properly extract the inner type when taking the decision of what to do.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1232478-inner-types-db-engine.patch | 3.57 KB | Damien Tournoud |
#4 | 1232478--inner-type-db-backend-4.patch | 2.44 KB | drunken monkey |
#3 | 1232478-inner-types-db-engine.patch | 2.44 KB | Damien Tournoud |
#1 | 1232478-inner-types-db-engine.patch | 2.35 KB | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis fixes it, and probably a couple of related bugs.
I see no obvious way of extending the automated tests to cover this, so I'll let it as an exercise for the reader.
Comment #2
drunken monkeyUnless I'm mistaken,
$new_inner_type
won't be set here, as you set that inside of the aboveif
block. You could just useseach_api_is_text_type($new_type)
instead – or extract the types outside of the blocks,of course.Otherwise, the patch looks good, thanks a lot for spotting this!
Comment #3
Damien Tournoud CreditAttribution: Damien Tournoud commentedGood catch. Here is a fixed version.
Comment #4
drunken monkeyPatch looks good, but I think there are still cases where this wouldn't work – mostly, when the list level of a field type changes (which might happen e.g. with data alterations, or when switching a field from single-valued to multi-valued). Please see if the attached patch works for you, too.
Comment #5
Damien Tournoud CreditAttribution: Damien Tournoud commentedOk, but this encovered another issue:
_search_api_admin_get_fields()
never updates the nesting level of a known field...Comment #6
drunken monkeyWow, awesome that you spotted and fixed that!
Patch looks good now and also seems to work – committed, thanks again!