-
Notifications
You must be signed in to change notification settings - Fork 105
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
'acf_qtranslate_acf_5_image' does not have a method 'wp_prepare_attachment_for_js' #783
Comments
+1 |
OK sorry i didn't find time to really check this. Will try to look but the main problem is that i don't have ACF PRO so i can't see the specific things related to that version. |
@herrvigg I can hook you up with the latest version zip, you only need a key to update. |
@chaofix @NewLifeMan Can you show me the full stack error message? This issue was fixed in #718 like this: qtranslate-xt/modules/acf/src/acf_5/fields/image.php Lines 54 to 57 in 1aeeee2
So i really don't see how qTranslate-XT could cause the problem. We should not try to call this function if it's not present in the class (or sub-class). Also, the fact you are downgrading to 5.8.2 and still have the problem does not make any sense. This function Are you sure you don't have conflicts with your plugin versions and loading (old) things that you shouldn't? |
Maybe you are using the legacy plugin? If so, you should disable it. But normally you can't use it together with the module if you check the options. Also be sure you don't have qTranslate-X enabled and use the last qTranslate-XT (3.7.1). But even if you were using it (and you shouldn't), the problem would disappear if you downgrade to ACF Pro 5.8.2 or lower. Then i don't know the changes after 5.8.3 but it's not even the problem here... |
Similar to #772 though @stefano88ita managed to find a workaround by commenting
But again this doesn't make any sense. So there's something still very strange about all these issues. I have the feeling the problem is not in qTranslate-XT but let me know more about the context. |
I installed a new clean "Wordpress" with q-translate latest plugin I can't supply a screenshots beyond what I already supplied |
@chaofix which qTranslate are you using? I really need to be sure about all the details because it doesn't make any sense. I still don't see which code is calling the function that raised the error! Technically speaking it don't understand how it could come from qTranslate-XT, this function is used nowhere directly (if it doesn't exist). First of all, be really sure you DON'T have the ACF qTranslate plugin enabled. Can you give me the detailed versions? Please go in the Troubleshooting section of qTranslate-XT and copy here the last block with the versions. I need first of all to verify:
|
Also if the problem comes from qTranslate i really need to see the whole calling stack. You can try in debug mode and see if you get more info. |
To avoid further confusions, i improved the debug info with more details about the plugins and their versions, now separated from the configuration data for better clarity. Do you have possibility to download the latest version of qTranslate-XT? It's very easy, you can use the zip archive from github (master branch). Then please give me the "Versions" info in the Troubleshooting section. |
I've the same issue...
version infos :
By consulting this log : i've see that i've installed another plugin : Advanced Custom Fields: qTranslate. if I disable this plugin, error disapear. Maybe it can help other users, but problem probably come from Advanced Custom Fields: qTranslate plugin, not from qtranslate-xt. @chaofix do you use Advanced Custom Fields: qTranslate extension to ? |
Yes that's it! Happy my last patch helped to sort this out 😄 As i expected, the problem comes from the legacy plugin "Advanced Custom Fields: qTranslate 1.7.25". But really, i don't understand how people can miss it. There is a HUGE notice like this: It's quite clear no?! Or i don't know... 😅 @chaofix @NewLifeMan can you confirm this fixes the problem? |
Regarding this, i resolved commenting this line because if you go deep you find: I know that in the perfect world a subclass must have the same methods (clearly if not cover by override), but in the wordpress buggy environment probably this won't work. Maybe you can cover the issue by adding in acf_qtranslate_acf_5_image something like: In the new version of plugin you add the line: Give a try! |
@stefano88ita i'm not sure i'm following. You wrote in #772 that the current version of qTranslate solved the problem, so it works without commenting anything, no? We are still waiting for @chaofix @NewLifeMan to confirm they have been using the legacy plugin causing the bug which is not in qTranslate-XT.
|
Also, you should definitly NOT call:
...before checking the function exists. This is the reason of the bug, because the function was removed in ACF PRO 5.8.3. The only reason i kept the conditional call is to support older versions of ACF as they were. |
You are right, in the new version it works without commenting anything, so the issue is closed. I updated also acf pro and wp_prepare_attachment_for_js has been removed, so the solution is correct, because the method doesn't exists and the filter is not added. Before that i was using acf 5.8.2 and wp_prepare_attachment_for_js was present and:
So my comment was only to try to explain what was wrong before the update! Sorry :) |
Then it's fine for now (at least for you). However i don't understand the point 2. If you use ACF 5.8.2 why would this call fail? It was exactly the same call as before (in case the function exists) and this has been working for ages. I didn't change anything here except the conditional check, see related commit. So again this doesn't make any sense. What version of WP and PHP are you using? |
It never works for me. When i dismiss Qtranslate + ACF qtranslate in favour of Qtranslate XT the error was there, only on uploading images in repeater's subfield... |
That sounds really weird... To be clear, there should only be two cases:
I can't see any rationale behind the last point you describe so i believe there's some other factor that is creating some confusion, maybe some cache or mixup with the versions. Or something else with PHP or WP that i'm missing (?!). In any case, imo this is solved from qT-XT 3.6.2 which was released especially for this problem. |
So.... these are the details PHP ver 7.2.26 |
@chaofix All right, qTranslate-X is the parent project, which is not maintained since June 2016... Here it's qTranslate-XT which is a different project. Please read carefully our README to see all the history behind and how to install it. Note for the support of ACF we have now a built-in module so you don't need the old plugin ACF for qTranslate, it is incompatible with qT-XT (see screenshot that i posted earlier in this thread). Switch to qT-XT and you will see many, many problems solved :) (apart from the bugs i don't even understand how qT-X still works on recent PHP versions...) |
ACF: 5.8.12 I have the same problem and the above solution is not working. |
You have all the history in this thread. Fixed in 3.6.2 almost one year ago... why are you using such an old version? Last release is 3.8.1. |
Sorry, I did not notice that qtranslate-XT does not notify for new versions in Wordpress. |
This issue is related to #718 - but this issue is closed there but I'm still having this issue with 5.8.1 or 5.8.2 or latest 5.8.7
When I tried view the media library, I see only a white page and when I tried to upload an image I got the message: "Could not insert post into the database"
I tried the following:
I'm with latest version of Wordpress - 5.3.2
There is space on the server
The text was updated successfully, but these errors were encountered: