kirby-upload-extended icon indicating copy to clipboard operation
kirby-upload-extended copied to clipboard

throws error when uploading in site

Open squareclouds opened this issue 3 years ago • 11 comments

hi there,

the plugin is throwing an error when i have set an excludedTemplate in the config. this is only happening in $site though! in all other pages the error is not shown.

grafik

i think the plugin checks for the page's template, but since site does not have one, it comes to an error

squareclouds avatar Jul 01 '21 08:07 squareclouds

PS: the excluded templates are referring to file templates or page templates? it is not clearly documented

squareclouds avatar Jul 01 '21 08:07 squareclouds

Hi @squareclouds, the excluded templates are referring to page templates.

Werbschaft avatar Jul 01 '21 08:07 Werbschaft

ok, thank you, i was using it wrong then. but again, as soon as a template is set in the config to explude, the site throws an error, because the code looks for the intendedTemplate() and i think site does not have that function

squareclouds avatar Jul 01 '21 09:07 squareclouds

do i see correctly that you also can not exclude certain file types. just wanted to upload a svg and did not work because tinypng does not support svg. any idea?

gesundheitundpersonal avatar Oct 21 '21 13:10 gesundheitundpersonal

This should not happen. Before TinyPNG is addressed, there is a query whether it is possible to enlarge or reduce the file. At most Kirby sees SVG files also as resizable but I can't imagine that.

<?php if ( $file->isResizable() ) : ?> ... <?php endif; ?>

Werbschaft avatar Oct 21 '21 13:10 Werbschaft

know the reason now. interestingly, the method you mentioned stupidly returns 'jpg' for the SVG.

<?php die($this->extension()); ?>

gesundheitundpersonal avatar Oct 21 '21 13:10 gesundheitundpersonal

That is strange. I just asked on Discord if anyone has a solution for that or if this is "by design"

Werbschaft avatar Oct 21 '21 13:10 Werbschaft

@gesundheitundpersonal have now also looked at the whole thing again and asked in the forum. Something is wrong with your file. With me SVGs are not reduced. But if your SVG outputs the extension JPG the error is quite clear.

Werbschaft avatar Oct 22 '21 11:10 Werbschaft

@gesundheitundpersonal have now also looked at the whole thing again and asked in the forum. Something is wrong with your file. With me SVGs are not reduced. But if your SVG outputs the extension JPG the error is quite clear.

sorry did i miss something? @gesundheitundpersonal was not the OP, it was me, and his problem had nothing to do with my issue, why has this been closed?

squareclouds avatar Oct 22 '21 12:10 squareclouds

Sorry, my fault. It's open again

Werbschaft avatar Oct 22 '21 12:10 Werbschaft

no harm done ^^

squareclouds avatar Oct 22 '21 12:10 squareclouds