1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 15:57:01 +02:00
This commit is contained in:
Ryan Cramer
2020-07-28 16:18:13 -04:00
parent 95203ac8f2
commit c339bd5fd2
2 changed files with 2 additions and 3 deletions

View File

@@ -946,7 +946,7 @@ class Pagefiles extends WireArray implements PageFieldValueInterface {
$this->fieldsTemplate = false;
/** @var FieldtypeFile $fieldtype */
$fieldtype = $field->type;
$template = $fieldtype ? $fieldtype->getFieldsTemplate($field) : null;
$template = $fieldtype && $fieldtype instanceof FieldtypeFile ? $fieldtype->getFieldsTemplate($field) : null;
if($template) $this->fieldsTemplate = $template;
}
}

View File

@@ -619,8 +619,7 @@ class PagefilesManager extends Wire {
if(!$key) continue; // first item, likely a filename, skip it
break; // not first item means end of ID sequence
}
$id = ltrim($part, '0'); // remove leading 0 and dash
$pageID = $id . $pageID;
$pageID = $part . $pageID;
}
return (int) $pageID;