Skip to content

Instantly share code, notes, and snippets.

@al-bglhk
Created February 28, 2020 06:46
Show Gist options
  • Save al-bglhk/3a80c015203a0b72bd5b4b4e11f2a059 to your computer and use it in GitHub Desktop.
Save al-bglhk/3a80c015203a0b72bd5b4b4e11f2a059 to your computer and use it in GitHub Desktop.
PHP Notice Undefined variable: singles - CraftCMS 3.4.8 / verbb/expanded-singles 1.0.9
diff --git a/src/services/SinglesList.php b/src/services/SinglesList.php
index f370c4f..9264778 100755
--- a/src/services/SinglesList.php
+++ b/src/services/SinglesList.php
@@ -155,6 +155,8 @@ JS;
$sites = Craft::$app->getSites()->getAllSites();
+ $singles = [];
+
foreach ($sections as $section) {
if ($section->type === Section::TYPE_SINGLE) {
$sectionSiteSettings = $section->getSiteSettings();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment