Problem/Motivation

The key database_text is not part of search_api_db.backend.schema. Which makes sense, because it's just a text field in the form.

But currently it will be exported in the database configuration files, which creates schema errors.

Proposed resolution

Prevent exporting of the database_text key in the database config files.

Remaining tasks

Do it.

User interface changes

API changes

Data model changes

Comments

chr.fritsch created an issue. See original summary.

chr.fritsch’s picture

Status: Active » Needs review
StatusFileSize
new634 bytes

Here is the patch

drunken monkey’s picture

Thanks a lot for reporting this issue!
I wasn't aware of this behavior – and it seems pretty counter-intuitive to me. Why would you want input from an "item" field by default?

The reasoning in \Drupal\Core\Render\Element\Item::getInfo() also seems to very accurately point out how nonsensical this default is:

      // Forms that show author fields to both anonymous and authenticated users
      // need to dynamically switch between #type 'textfield' and #type 'item'
      // to automatically take over the authenticated user's information.
      // Therefore, we allow #type 'item' to receive input, which is internally
      // assigned by Form API based on the #default_value or #value properties.

I.e.: Instead of letting those few forms that really need it set this manually, we're picking a counter-intuitive default value for everyone else …

But OK, enough ranting. The patch obviously fixes this for us, so great job!

Before I commit this, though: Do you know how we can trigger a config schema check within our tests? Seems like a nice idea to add a test not for this bug in particular (which would of course be trivial), but generally for whether re-saving our default server leads to a schema violation. The attached doesn't seem to be enough for that.

Status: Needs review » Needs work
drunken monkey’s picture

Status: Needs work » Needs review
StatusFileSize
new1.41 KB

Oh, seems I was mistaken. Even better.
Combined patch attached.

drunken monkey’s picture

Status: Needs review » Fixed

Awesome! Committed.
Thanks again for the report and the patch!

Status: Fixed » Closed (fixed)

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