Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #49 from Dolphiq/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
johanzandstra authored Aug 3, 2020
2 parents 5c062c6 + d588335 commit de300e6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# sitemap Changelog
## 1.3.0 - 2030-07-03
### Fixed
- Fixed compatibility with Craft CMS 3.4 +
- Added fix for deleted sites
- Fix and/or operation order

## 1.2.0 - 2019-11-01
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "dolphiq/sitemap",
"description": "Craft 3 plugin that provides an easy way to provide and manage a XML sitemap for search engines like Google and Bing",
"type": "craft-plugin",
"version": "1.2.0",
"version": "1.3.0",
"keywords": [
"craft",
"cms",
Expand Down
1 change: 1 addition & 0 deletions src/controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ private function _createEntrySectionQuery(): Query
->leftJoin('{{%dolphiq_sitemap_entries}} sitemap_entries', '[[sections.id]] = [[sitemap_entries.linkId]] AND [[sitemap_entries.type]] = "section"')

->groupBy(['sections.id'])
->where(['sections.dateDeleted' => null])
->orderBy(['type' => SORT_ASC],['name' => SORT_ASC]);
}

Expand Down
9 changes: 5 additions & 4 deletions src/controllers/SitemapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,16 @@ private function _createEntrySectionQuery(): Query
'[[sections_sites.sectionId]] = [[sections.id]] AND [[sections_sites.hasUrls]] = 1')
->innerJoin('{{%entries}} entries', '[[sections.id]] = [[entries.sectionId]]')
->andWhere(['<=', 'entries.postDate', $currentDate])
->andWhere(['>', 'entries.expiryDate', $currentDate])
->orWhere(['entries.expiryDate'=> null])
->andWhere(['or', 'entries.expiryDate > :currentDate', 'entries.expiryDate is null'], [':currentDate' => $currentDate])
->innerJoin('{{%elements}} elements', '[[entries.id]] = [[elements.id]] AND [[elements.enabled]] = 1')
->innerJoin('{{%elements_sites}} elements_sites',
'[[elements_sites.elementId]] = [[elements.id]] AND [[elements_sites.enabled]] = 1')
->innerJoin('{{%sites}} sites', '[[elements_sites.siteId]] = [[sites.id]]')
->andWhere(['elements.dateDeleted' => null])
->andWhere(['sites.dateDeleted' => null])
->andWhere(['elements.archived' => false])
->andWhere(['elements.draftId' => null])
->andWhere(['elements.revisionId' => null])


->groupBy(['elements_sites.id']);
}

Expand Down Expand Up @@ -206,6 +205,7 @@ private function _createAlternateSectionQuery($elementId): Query
'[[elements_sites.elementId]] = [[elements.id]] AND [[elements_sites.enabled]] = 1')
->innerJoin('{{%sites}} sites', '[[elements_sites.siteId]] = [[sites.id]]')
->where(['=', '[[elements_sites.elementId]]', $elementId])
->andWhere(['sites.dateDeleted' => null])
->groupBy(['elements_sites.id']);
}

Expand All @@ -230,6 +230,7 @@ private function _createEntryCategoryQuery(): Query
'[[elements_sites.elementId]] = [[elements.id]] AND [[elements_sites.enabled]] = 1')
->innerJoin('{{%sites}} sites', '[[elements_sites.siteId]] = [[sites.id]]')
->andWhere(['elements.dateDeleted' => null])
->andWhere(['sites.dateDeleted' => null])
->groupBy(['elements_sites.id']);
}

Expand Down

0 comments on commit de300e6

Please sign in to comment.