-
Notifications
You must be signed in to change notification settings - Fork 148
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
Error when add/update post - Invalid argument supplied for foreach() - qtx_admin.php on line 14 #392
Comments
I still have no idea how that happens ... Probably older version of PHP is at fault, but what exactly is happening? Nobody troubleshooted it to the answer. We could never reproduce it and we have never gained an admin access to troubleshoot it. Would you have enough PHP skills to figure out what is going on? |
I'm developing on my localhost, I didn't test it online yet, but I will give it a try. Anyway my php version is 4.6.1, so I don't think it's a php problem. I'm using the qtranslate-x with the ACF to translate a several fields. I think the problem is when this fields are not filled so the $content on the foreach is NULL, in others words, the argument is invalid. And no, i'm not that good in PHP :\ |
4.6.1 is pretty low by now. NULL is what I do not understand, $content comes from $_POST, which should never have any nulls. Where this NULL come from? Sounds like an imperfection in ACF, which is not important anywhere else, but just causes this message. Could you try to figure out a simple reproducible case? |
Yeah sorry, I was telling the phpMyAdmin version. The php is 5.5.19. NULL I think comes from the fields that have not been filled. |
Yes, they apparently come from that, but it should not be a case. Empty fields come as empty strings, not NULL, in normal case. We can put "if(is_null(...)) ...", but it is strange to run an extra code just to offset either older PHP or imperfections in other plugin development? I would like to find out the true cause of this first. And for that I need a way to reproduce it. |
I have the ACF pro version. I can give you access to the development in if you want. |
Access to localhost? I would think ACF Pro and regular would behave the same, as it seems basic. Could you describe the minimum steps to reproduce first? What kind of field one need to create and not to fill and where in order to see this message? Please, assume no knowledge of ACF for a reader. Maybe I will eventually able to reproduce on my localhost. |
I have a dev environment on a server. What do you need specifically? I have several fields to fill (for example: text fields, wysiwyg editors, repeaters, images e etc) for this post and those fields, except the images, can be translated by the q-translate. |
I've never done anything with ACF and I would not like to spend time to learn. It would be great, if you could give me set of instructions what to do to see the error message you are seeing. |
I tried a few fields, and I cannot hit this problem, never was able to to. If you wish to help, give us precise instructions what to do to reproduce, or admin access to a site with explanation what page to go and wht to do to observe the problem. |
Hi John, yeah ofc. I can't give you the access right because I don't have the access here you my personal computer, but monday on the work I can give it to you or reproduce another environment where you can see what going on. |
Hi john. Give me your email so I can send you the access. |
The contact information is in the link I sent you: https://qtranslatexteam.wordpress.com/contact-us/ |
Thank you very much, @NC0STA, for setting up a test server for us.We would never be able to reproduce it on our servers, because it happens when a page has a hidden, unused translatable field and when user has the first language chosen when "Update" is pressed 👍 It happens with ACF mostly, but potentially can happen in other plugins too. The fix is here: 7586ff0 |
FWIW I just installed the very latest version from the git repo (3.4.8) and had this exact error (on ACF site with fields moved around). I had to manually apply the "isset" fix (that @johnclause links to immediately above) to the |
I had the same problem as @riverofjanuary and saw that the fix is in the |
Had the same issue, @dxit-gg answer fixed it for me too. Also using ACF pro. |
I had two conflicts with ACF-qtranslate (the ACF integration plugin). 1) I got this error on line 14. Thank you for the fix (I haven't confirmed that it's working because I don't understand what you mean by 'first language' in this comment: #392 (comment). I have the issue but haven't been able to reproduce reliably. Would be great if you could clarify). 2) When I edited and saved group ACF fields, the fields I had put inside groups were all replicated outside the groups but without field names (funkjedi/acf-qtranslate#111). After a quick test this also seems to have been fixed. Is that possible? I really hope it doesn't happen any more. |
I am using the stable branch now with the fix and just had this error again (invalid argument on line 14). My site deletes the entirety of the post in the language that's being edited (but not the other languages). I've upped the max_input_vars for php and hope that might help. Very glad if anyone has other ideas. |
I still get this error. |
Same error here. |
I solved this problem.
|
I get a error when I try to add or update a post:
I saw a thread on wordpress support page with the same error - https://wordpress.org/support/topic/warning-shown-on-page-update-qtranslate-xadminqtx_adminphp-on-line-14?replies=8
I'm using the workaround set by david.sota.ads, but like John Clause said this will only solve the error messages not the actual problem.
The text was updated successfully, but these errors were encountered: