diff --git a/src/Entity/Attachments/Attachment.php b/src/Entity/Attachments/Attachment.php
index 9518d2f9..3c8d890d 100644
--- a/src/Entity/Attachments/Attachment.php
+++ b/src/Entity/Attachments/Attachment.php
@@ -609,12 +609,17 @@ abstract class Attachment extends AbstractNamedDBElement
/**
* Checks if the given path is a path to a builtin resource.
*
- * @param string $path The path that should be checked
+ * @param string|null $path The path that should be checked
*
* @return bool true if the path is pointing to a builtin resource
*/
- public static function checkIfBuiltin(string $path): bool
+ public static function checkIfBuiltin(?string $path): bool
{
+ //An empty path can't be a builtin
+ if ($path === null) {
+ return false;
+ }
+
//After the %PLACEHOLDER% comes a slash, so we can check if we have a placeholder via explode
$tmp = explode('/', $path);
//Builtins must have a %PLACEHOLDER% construction
diff --git a/src/Services/Attachments/AttachmentPathResolver.php b/src/Services/Attachments/AttachmentPathResolver.php
index e3e7a3ca..1b52c89b 100644
--- a/src/Services/Attachments/AttachmentPathResolver.php
+++ b/src/Services/Attachments/AttachmentPathResolver.php
@@ -115,12 +115,16 @@ class AttachmentPathResolver
* Converts an relative placeholder filepath (with %MEDIA% or older %BASE%) to an absolute filepath on disk.
* The directory separator is always /. Relative pathes are not realy possible (.. is striped).
*
- * @param string $placeholder_path the filepath with placeholder for which the real path should be determined
+ * @param string|null $placeholder_path the filepath with placeholder for which the real path should be determined
*
* @return string|null The absolute real path of the file, or null if the placeholder path is invalid
*/
- public function placeholderToRealPath(string $placeholder_path): ?string
+ public function placeholderToRealPath(?string $placeholder_path): ?string
{
+ if (null === $placeholder_path) {
+ return null;
+ }
+
//The new attachments use %MEDIA% as placeholders, which is the directory set in media_directory
//Older path entries are given via %BASE% which was the project root
diff --git a/templates/parts/edit/edit_form_styles.html.twig b/templates/parts/edit/edit_form_styles.html.twig
index 1175e32c..d90242f8 100644
--- a/templates/parts/edit/edit_form_styles.html.twig
+++ b/templates/parts/edit/edit_form_styles.html.twig
@@ -188,7 +188,7 @@
{% else %}
- {% trans %}attachment.view{% endtrans %}
+ {% trans %}attachment.view_local{% endtrans %}
{% endif %}
{% else %}