- Issue created by @alberto56
- 🇨🇦Canada alberto56
It seems that line 330 of core/lib/Drupal/Core/Database/Query/Merge.php has this code:
/** * Sets a single key field to be used as condition for this query. * * Same as \Drupal\Core\Database\Query\Merge::keys() but offering a signature * that is more natural for the case of a single key. * * @param string $field * The name of the field to set. * @param mixed $value * The value to set into the database. * * @return $this * * @see \Drupal\Core\Database\Query\Merge::keys() */ public function key($field, $value = NULL) { assert(is_string($field)); $this->keys([$field => $value]); return $this; }
But line 450 of src/Form/AbjsTestForm.php has the following code:
$this->database->merge('abjs_test_condition') ->key(['tid' => $tid, 'cid' => $cid]) ->fields(['tid' => $tid, 'cid' => $cid])->execute();
In other words, AbjsTestForm. is passing an array [tid=>tid, cid=>cid] to a function that fails if you do not pass a string to it.
- 🇨🇦Canada alberto56
This assertion was added to Drupal core in 📌 [11.x] Adjust Database API to remove deprecated Drupal 10 code in Drupal 11 Fixed for Drupal 11.
So presumably this module works in Drupal 10, although I have not tested it.
The problematic code exists in abjs commit 6aaf7c4 - Drupal 11 compatiblility fixes, which to my understanding is the latest commit.
- 🇨🇦Canada alberto56
Confirming the module works on Drupal 10, but not Drupal 11. Changing the title accordingly