Merge pull request #620 from wernerkrauss/patch-1

FIX: augmentLoadLazyFields doesn't work with renamed tables
This commit is contained in:
Serge Latyntsev 2020-08-28 11:26:03 +12:00 committed by GitHub
commit 46f2608cfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,9 +57,10 @@ class BlogPostFilter extends DataExtension
*/
public function augmentLoadLazyFields(SQLSelect &$query, DataQuery &$dataQuery = null, $dataObject)
{
$blogPostTable = DataObject::getSchema()->tableName(BlogPost::class);
$dataQuery->innerJoin(
DataObject::getSchema()->tableName(BlogPost::class),
'"SiteTree"."ID" = "BlogPost"."ID"'
$blogPostTable,
'"SiteTree"."ID" = "' . $blogPostTable . '"."ID"'
);
}
}