-
Notifications
You must be signed in to change notification settings - Fork 237
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
Issue with the image custom field (missing thumb preivew) #624
Comments
Hi @speedwheel, Thank you for the thorough example and additional information of the issue. We have released v3.0 in which the issue should be fixed. Can you try updating to the latest version by using:
and let me know if this solves the problem? |
Hello @jorostoyanov, thank you for the quick reply, I 've updated using |
Hi @speedwheel, In your case the value stored in database for your image fields is the URL of the image and since it is not hosted on the same domain as your site (because of the "Parallelize Downloads" plugin) Carbon Fields is not able to determine the attachment ID and thus cannot display a preview of the image. Because of that, we are introducing a new filter You will be able to hook a function to this filter and apply custom logic to determine the attachment ID like so:
I noticed that the only difference in the attachment URL is the domain. You can try replacing it with the domain of your site like the example above. If this doesn't help, you might have to dig deeper and find how the "Parallelize Downloads" plugin keeps the association between the external url and the local attachment. The filter is now in the Here is the associated commit -- b3f80f2 Hope this helps! Let me know, if you stumble upon any issues :) |
Closing this issue since the fix is released in Carbon Fields 3.0.1. |
@vvasilev- I've updated to 3.0.1 but the problem still perists. LE: it works with @jorostoyanov snippet code, thanks. |
This may not be an issue for most people, but it was still an issue for me on 3.1.1. I updated my permalinks and it solved my issue. I was getting a 404 on the rest_route. "If it displays a 404 error then update permalinks first" https://stackoverflow.com/questions/34670533/wordpress-rest-api-wp-api-404-error works on all the permalink options besides "plain". I didn't try any custom permalink configurations yet. |
The problem persists in version 3.1.18, although the file is on the same hosting and even changing the permalinks, with ->set_value_type ('url') the url is saved, but the preview shows nothing. |
have the same problem in carbon field version 3.3.0, image which has been saved not show the preview in edit page |
Same problem in version 3.3.4. |
fast fix
admin css
|
Version
Expected Behavior
The image custom field should show a thumb preview with the selected image.
Actual Behavior
The image custom field is showing a 0 instead, but the value is saved. This happens only after you refresh the page. What is weird is that I have 2 custom fields of type image, but the first one works just fine.
Container definition
Steps to Reproduce the Problem
Comments
From what I see the image from the first custom field was added in the past with a different verion of carbon fields, so that's why is still showing. If I remove it and add it again it will also show 0.
Any tips?
LE: I found the problem, but I am not sure how to fix it:
Any fixes so the attachments also work with custom domain different then the one from the main website?
The text was updated successfully, but these errors were encountered: