Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not recognizing asset as embedded on live site #61

Open
brycekirk opened this issue Apr 11, 2018 · 4 comments
Open

Not recognizing asset as embedded on live site #61

brycekirk opened this issue Apr 11, 2018 · 4 comments

Comments

@brycekirk
Copy link

brycekirk commented Apr 11, 2018

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 %} <video controls> <source src="{{ asset.url }}" type="{{ asset.getMimeType() }}"> </video> {% 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
Copy link
Contributor

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
Copy link
Author

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

@benjamminf
Copy link
Contributor

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

@brycekirk
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants