Create/update page without box information resulted in error
authorMarcel Werk <burntime@woltlab.com>
Mon, 11 Apr 2022 09:01:36 +0000 (11:01 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 11 Apr 2022 09:01:36 +0000 (11:01 +0200)
wcfsetup/install/files/lib/data/page/PageAction.class.php

index 954b2186541d65ec1a153ded02027028f6b71ebe..0393f1f8733a9a6da3950db4c0a5351b8e00fbe7 100644 (file)
@@ -152,11 +152,11 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction,
                     $boxData['visible'],
                 ]);
             }
-        }
 
-        // update box conditions
-        foreach ($this->parameters['boxToPage'] as $boxData) {
-            $this->createPageConditionForBox($boxData['boxID'], [$page]);
+            // update box conditions
+            foreach ($this->parameters['boxToPage'] as $boxData) {
+                $this->createPageConditionForBox($boxData['boxID'], [$page]);
+            }
         }
 
         // save template
@@ -297,11 +297,11 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction,
                     }
                 }
             }
-        }
 
-        // update box conditions
-        foreach ($this->parameters['boxToPage'] as $boxData) {
-            $this->createPageConditionForBox($boxData['boxID'], $this->getObjects());
+            // update box conditions
+            foreach ($this->parameters['boxToPage'] as $boxData) {
+                $this->createPageConditionForBox($boxData['boxID'], $this->getObjects());
+            }
         }
     }