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

Uncaught InvalidArgumentException: Missing "qtranslate-edit-language" field in $_REQUEST! #753

Closed
bagaweb opened this issue Nov 3, 2019 · 9 comments
Labels
core Core functionalities, including the admin section need info The submitter must provide more info

Comments

@bagaweb
Copy link

bagaweb commented Nov 3, 2019

I cannot understand why but I receive this error when trying to publish a new page with 3.7.1.

Un errore di E_ERROR è stato causato nella linea 206 del file /home/public_html/wp-content/plugins/qtranslate-xt/admin/qtx_admin_utils.php. Messaggio di errore: Uncaught InvalidArgumentException: Missing "qtranslate-edit-language" field in $_REQUEST! in /home/public_html/wp-content/plugins/qtranslate-xt/admin/qtx_admin_utils.php:206
Stack trace:
#0 /home/public_html/wp-content/plugins/qtranslate-xt/admin/qtx_admin.php(94): qtranxf_getLanguageEdit()
#1 /home/public_html/wp-includes/class-wp-hook.php(286): qtranxf_collect_translations_posted('')
#2 /home/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#3 /home/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#4 /home/public_html/wp-settings.php(394): do_action('plugins_loaded')
#5 /home/public_html/wp-config.php(90): require_once('/home/...')
#6 /home/public_html/wp-load.php(37): require_once('/home/...')
#7 /home/public_html/wp-admin/admin.php(34): require_once('/home/...')
#8 /home/public_html/wp-admin/post.php(12): require_once('/home/...'

Had to revert to 3.6.3 to be able to publish without errors.

@herrvigg
Copy link
Collaborator

herrvigg commented Nov 3, 2019

Yes this is something new i've added to clearly detect invalid post requests. Here you have some qtranslate-fields in your request, but the language that should be given by qtranslate-edit-language is missing. This comes from the submitted form and it should never happen! So the exception is a security belt. Before, the language was sent in the admin edit cookie but i removed that one in 3.7.0 (there were several reasons for that).

Can you better detail the context of your post request?

@herrvigg
Copy link
Collaborator

herrvigg commented Nov 3, 2019

Which edit mode are you using: LSB, RAW or single language?

@herrvigg
Copy link
Collaborator

herrvigg commented Nov 3, 2019

@bagaweb I've tried this again and it works fine with all modes (anyway this should not concern the raw mode). FYI the hidden field qtranslate-edit-language is created dynamically client-side in javascript when the hooks are added so check that you don't have a JS error in the browser console. If the hidden field is created correctly it should be transmitted with the form normally when you submit the page.

@herrvigg herrvigg added core Core functionalities, including the admin section need info The submitter must provide more info labels Nov 3, 2019
@bagaweb
Copy link
Author

bagaweb commented Nov 4, 2019

I was editing in LSB mode. I tried to reproduce the problem on a localhost installation but everything works fine. I need to try again on the live site and check the browser console.

@herrvigg
Copy link
Collaborator

herrvigg commented Mar 4, 2020

Not sure what happened but i believe this is working fine. If there is a specific case please provide more info so we can reproduce it.

@herrvigg herrvigg closed this as completed Mar 4, 2020
@devkhiem2003
Copy link

I am having the same problem as you. Your problem has been solved, if it has been handled please guide me to fix this problem. Thanks for watching. We hope to hear from you!

@pawelskaba
Copy link

@bagaweb sorry for digging but I've approached the same issue with a recent version of this plugin. What might cause it? I'm receiving it when trying to add any changes into menu view (newest Wordpress and newest Qtranslate_XT installed)

@bagaweb
Copy link
Author

bagaweb commented Apr 5, 2021

@pawelskaba I cannot remember what was causing this problem, it was too long ago, sorry.

@Buildbetter
Copy link

Buildbetter commented Mar 6, 2024

The problem exists when i edit a admin CPT post. For this CPT i had disabled the translation option in QTranslate settings Menu - (Languages -> Advanced tab - i had disable For this cpt).
I modified the cpt post edit form for my need so i include this line:

And on save post the problem gone. :)
OR if you enable translation for this CPT all works ok!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core functionalities, including the admin section need info The submitter must provide more info
Projects
None yet
Development

No branches or pull requests

5 participants