aerni / statamic-zipper

The easy way to zip your Statamic assets on the fly
https://statamic.com/addons/aerni/zipper
MIT License
0 stars 1 forks source link

500 server error when trying to zip #5

Closed nn-dmt closed 2 years ago

nn-dmt commented 2 years ago

I am calling in zipper as follows

<a href="{{ zip:artwork }}">test</a>

which cause a 500 server error.

PHP 8, laravel 9, statamic 3

aerni commented 2 years ago

What does your error log say?

nn-dmt commented 2 years ago

Hello thanks for the quick reply

Here is the logged error:

[2022-05-19 01:54:18] local.ERROR: Call to a member function raw() on null {"userId":"54924891-a274-4d26-a470-31a14707808f","exception":"[object] (Error(code: 0): Call to a member function raw() on null at /var/www/laravel/vendor/aerni/zipper/src/ZipperTags.php:54)
aerni commented 2 years ago

Ok, it seems like the artwork variable doesn't actually contain anything? You can check if the variable exists by dumping it on the frontend with {{ artwork | dump }}.

nn-dmt commented 2 years ago

That doesn't make sense, considering i am calling in {{ artwork }} in the same antlers file to pull in the album artwork for a release and display it. Do i need to include the sub-field name? like {{ artwork:upload_files }} ?

aerni commented 2 years ago

I suppose artwork is an asset fieldtype? I'm going to need some more information from you so I can reproduce this issue. Also, I'm working on a complete refactor right now. So this problem might be resolved anyways.

nn-dmt commented 2 years ago

Yes, artwork is an asset and links to a specific assets folder for album artwork, and that same artwork has no other issues displaying on the site when i call it in via tags.

The artwork was just a test to see if I could get zipper working, as the actual goal is to have it zip up the Audio files on a release which are individual 'tracks' in a collection but each of those tracks has its own file uploaded. That seemed a bit more difficult to get working so I just wanted to get something simple working by zipping a single image

nn-dmt commented 2 years ago

Also thanks for the update and letting me know its being re-factored. I can probably implement a workaround until it has a fix available.

This is an unrelated thread but I was also having issues with snipcart(which i purchased) in this same instance, where it would not let me create a new entry for product and gave me a 500 error as well. I am going to give an update in your snipcart repo once i check the logs

nn-dmt commented 2 years ago

Ok, it seems like the artwork variable doesn't actually contain anything? You can check if the variable exists by dumping it on the frontend with {{ artwork | dump }}.

Okay i am extremely sorry for the confusion i checked my files again and I was missing a quotation mark -_- i can get the artwork to zip now. sorry again

aerni commented 2 years ago

Haha, no worries. Been there myself ;-)