mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
FIX augmentLoadLazyFields doesn't work with renamed tables
On a project I renamed the table BlogPosts to News_Posts which led to a broken join clause.
This commit is contained in:
parent
92eb4f5da0
commit
dd8ce8b8dd
@ -57,9 +57,10 @@ class BlogPostFilter extends DataExtension
|
|||||||
*/
|
*/
|
||||||
public function augmentLoadLazyFields(SQLSelect &$query, DataQuery &$dataQuery = null, $dataObject)
|
public function augmentLoadLazyFields(SQLSelect &$query, DataQuery &$dataQuery = null, $dataObject)
|
||||||
{
|
{
|
||||||
|
$blogPostTable = DataObject::getSchema()->tableName(BlogPost::class);
|
||||||
$dataQuery->innerJoin(
|
$dataQuery->innerJoin(
|
||||||
DataObject::getSchema()->tableName(BlogPost::class),
|
$blogPostTable,
|
||||||
'"SiteTree"."ID" = "BlogPost"."ID"'
|
'"SiteTree"."ID" = "' . $blogPostTable . '"."ID"'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user