Skip to content

Commit ffa451a

Browse files
committed
Merge branch '5.x' into 6.x
# Conflicts: # CHANGELOG.md
2 parents ea39384 + 969527a commit ffa451a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Fixed a bug that could occur when importing into a Matrix field with no blocks. ([#1622](https://github.com/craftcms/feed-me/pull/1622))
1212
- Fixed a bug that would happen when matching elements on the keywords `and` and `or`. ([#1629](https://github.com/craftcms/feed-me/pull/1629))
1313
- Fixes a bug where importing _only_ a title for a Matrix entry would result in that nested entry not being imported. ([#1630](https://github.com/craftcms/feed-me/pull/1630))
14+
- Fixed an issue that could occur when running garbage collection before importing a feed when using PostgreSQL. ([#1632](https://github.com/craftcms/feed-me/pull/1632))
1415
- Fixed a regression that happened in 5.3.0 where imports into relational field would not remove existing relations if it was required. ([#1623](https://github.com/craftcms/feed-me/pull/1623))
1516
- Fixed a regression where `EVENT_BEFORE_PROCESS_FEED` was called once per batch and not once per page. ([#1628](https://github.com/craftcms/feed-me/pull/1628))
1617

src/services/Process.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ public function beforeProcessFeed(FeedModel $feed, array $feedData)
8484
$gc = Craft::$app->getGc();
8585
$gc->deleteAllTrashed = true;
8686
$gc->run(true);
87+
88+
// close DB connection so that \PDO::ATTR_EMULATE_PREPARES is set back to false;
89+
// https://github.com/yiisoft/yii2/blob/2.0.52/framework/db/pgsql/QueryBuilder.php#L225
90+
// this caused an SQL error when using pgsql and attempting to match existing elements
91+
// based on e.g. title that consists of only a number;
92+
// "SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: character varying = bigint LINE 8"
93+
// "HINT: No operator matches the given name and argument types. You might need to add explicit type casts."
94+
Craft::$app->getDb()->close();
8795
} else {
8896
Plugin::getInstance()->getLogs()->prune();
8997
}

0 commit comments

Comments
 (0)