Skip to content

Commit

Permalink
wrong column names (#72)
Browse files Browse the repository at this point in the history
fix #71
  • Loading branch information
pascalmoser authored Oct 22, 2024
1 parent f76f77f commit 6d23159
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

---

## 4.0.2
- [BUGFIX] remove `o_`-Prefixes for object columns [#71](https://github.com/dachcom-digital/pimcore-news/issues/71)

## 4.0.1
- [IMPROVEMENT] Update Typehint in News areabrick to be more specific [#69](https://github.com/dachcom-digital/pimcore-news/issues/69)
- If you have overwritten the `News` areabrick, please check you setup and make adjustments if necessary.
Expand Down
10 changes: 5 additions & 5 deletions src/NewsBundle/Model/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getEntries(bool $includeChildCategories = false): array
$list = DataObject\NewsEntry::getList();

if (!$includeChildCategories) {
$list->setCondition('o_published = 1 AND categories LIKE "%,' . $this->getId() . ',%"');
$list->setCondition('published = 1 AND categories LIKE "%,' . $this->getId() . ',%"');
} else {
$categories = $this->getCatChilds();
$categoriesWhere = [];
Expand All @@ -49,7 +49,7 @@ public function getEntries(bool $includeChildCategories = false): array
$categoriesWhere[] = 'categories LIKE ",' . $cat . ',%"';
}

$list->setCondition('o_published = 1 AND (' . implode(' OR ', $categoriesWhere) . ')');
$list->setCondition('published = 1 AND (' . implode(' OR ', $categoriesWhere) . ')');
}

return $list->getObjects();
Expand All @@ -70,7 +70,7 @@ public function getEntriesPaging(
$list = DataObject\NewsEntry::getList();

if (!$includeChildCategories) {
$list->setCondition('o_published = 1 AND categories LIKE "%,' . $this->getId() . ',%"');
$list->setCondition('published = 1 AND categories LIKE "%,' . $this->getId() . ',%"');
} else {
$categories = $this->getCatChilds();
$categoriesWhere = [];
Expand All @@ -79,7 +79,7 @@ public function getEntriesPaging(
$categoriesWhere[] = 'categories LIKE "%,' . $cat . ',%"';
}

$list->setCondition('o_published = 1 AND (' . implode(' OR ', $categoriesWhere) . ')');
$list->setCondition('published = 1 AND (' . implode(' OR ', $categoriesWhere) . ')');
}

$list->setOrderKey($sort['name']);
Expand Down Expand Up @@ -131,7 +131,7 @@ public function getHierarchy(): array
public function getChildCategories(): array
{
$list = DataObject\NewsCategory::getList();
$list->setCondition('o_parentId = ?', [$this->getId()]);
$list->setCondition('parentId = ?', [$this->getId()]);

return $list->getObjects();
}
Expand Down
2 changes: 1 addition & 1 deletion src/NewsBundle/Model/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public static function getCategoriesRecursive(?CategoryInterface $category, $inc
$categories = [$category->getId()];
if ($includeSubCategories === true) {
$entries = DataObject\NewsCategory::getList();
$entries->setCondition('o_path LIKE "' . $category->getFullPath() . '%"');
$entries->setCondition('path LIKE "' . $category->getFullPath() . '%"');
foreach ($entries->load() as $entry) {
$categories[] = $entry->getId();
}
Expand Down

0 comments on commit 6d23159

Please sign in to comment.