spicywebau / craft-embedded-assets

Manage YouTube videos, Instagram photos and more as first class assets in Craft CMS
MIT License
171 stars 35 forks source link

Not recognizing asset as embedded on live site #61

Open brycekirk opened 6 years ago

brycekirk commented 6 years ago

I've got the following chunk of code to output the asset using this plugin if it's embedded, and insert the link into an HTML video tag if it's a local file:

`{% for asset in block.video %} {% set embed = craft.embeddedAssets.fromAsset(asset) %} {% if embed %} {{ embed.safeHtml|raw }} {% else %}

{% endif %}

{% endfor %}`

It works perfectly on my local MAMP server, and on my staging site, recognizing the asset as embedded and outputting the proper code. When I push to the live site (hosted with Media Temple), however, it's not recognizing the asset as embedded, and outputting the code under "else" resulting in the follow broken code:

<source src="/assets/vid/embed_Sporting-Life-Powder-Matt.json" type="application/json">

I've double checked the template on the server, it's the exact same as my working local version. Changing the server's PHP version to 7 doesn't fix it. I don't understand what could be happening here. I've also tried this:

{% if craft.embeddedAssets.isEmbedded(asset) %}

Which, again, works locally but not on the live site. This is driving me nuts.

Edit: For some reason, the live site is uploading them as JSON instead of embedded assets Local site:

screen shot 2018-04-11 at 4 28 14 pm

Live site:

screen shot 2018-04-11 at 4 29 08 pm
benjamminf commented 6 years ago

Embedded assets are JSON files, so that's all good. It seems reading the source of the JSON files is the problem. This might be caused by file permissions. Your assets may have had their read permissions changed when uploading them. Make sure they're set to 0755 and try again.

brycekirk commented 6 years ago

I changes the file permissions (all assets now listed as -rwxr-xr-x in terminal) and the problem persists :(

benjamminf commented 6 years ago

Can you check the log file for the plugin under the storage/logs directory and see if it's reporting any issues?

brycekirk commented 6 years ago

Can't find storage/logs, but on the server there's a phperrors.log under craft/storage/runtime/logs. Attached. phperrors.log