$existing = $this->finder()->where('title', $ids)->where('language_id', 0)->keyedBy('title')->fetch();
//$existing = $this->finder()->where('title', $ids)->where('language_id', 0)->keyedBy('title')->fetch();
$entity = $existing[$id] ?? $this->create();
$existingPhrase = $this->em->findOne('XF:phrase', [
'title' => $entry['title'],
'language_id' => 0
]);
$entity = $existingPhrase ?? $this->create();
There may be a delay before changes are rolled out to the XenForo Community.Break the phrase import query into chunks to avoid a MariaDB performance regression.
Figured as much...Just to clarify, my comment about fixing the MariaDB mess was aimed at MariaDB, NOT Xenforo.
Quick and dirty fix should be as follows.
In src/XF/AddOn/DataType/Phrase.php, find:
Code:$existing = $this->finder()->where('title', $ids)->where('language_id', 0)->keyedBy('title')->fetch();
Replace with:
Code://$existing = $this->finder()->where('title', $ids)->where('language_id', 0)->keyedBy('title')->fetch();
In the same file, then find: (13 lines below)
Code:$entity = $existing[$id] ?? $this->create();
Replace with:
Code:$existingPhrase = $this->em->findOne('XF:phrase', [ 'title' => $entry['title'], 'language_id' => 0 ]); $entity = $existingPhrase ?? $this->create();
Replacing that line with the one I mentioned should be fine (provided you're running PHP7, which you likely would be).Ιn my case and in the second part of your solution i see this in line 69...
Code:$entity = isset($existing[$id]) ? $existing[$id] : $this->create();
Do i have to make the same changes you suggest?
But regardless of where the bug is, from the user point of view it’s MariaDB upgrade that broke their applications. And they cannot always move to PHP 7.3 or wait for Oracle to fix connectors.
We use essential cookies to make this site work, and optional cookies to enhance your experience.