1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 00:06:55 +02:00
This commit is contained in:
Ryan Cramer
2024-05-10 12:21:31 -04:00
parent 397bb0b382
commit eaed402cfb

View File

@@ -668,9 +668,9 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
$fieldName = (string) $this->hasField; $fieldName = (string) $this->hasField;
} }
$postUrl = $page->editUrl(); $postUrl = $page ? $page->editUrl() : '';
if($nameAttr != $fieldName) { if($nameAttr != $fieldName && $fieldName && $postUrl) {
// file context for output after upload in case upload starts from a // file context for output after upload in case upload starts from a
// page that is different from the one where the the file actually lives, // page that is different from the one where the the file actually lives,
// but file upload is posted to the correct page. this ensures the resulting // but file upload is posted to the correct page. this ensures the resulting