qtranslate / qtranslate-xt

qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.
GNU General Public License v2.0
550 stars 103 forks source link

ACF integration problem #1287

Closed MarkArgent closed 1 year ago

MarkArgent commented 1 year ago

I have a site that uses ACF to create a range of custom data types (edited via edit.php), and also to add additional information to users' profiles (edited via user-edit.php).

On things edited via edit.php things are now fine.

But on user profiles, edited via user-edit.php, I get blue borders on translatable fields, but don't get the flags to switch language, and don't have qtranxs-lang-switch list items that I see on edit.php.

I reported this a fortnight ago (#1285) but there hasn't been a response, so I guess that fixing this is non-trivial. While I am waiting, as a temporary fix, I have inserted the qtranxs-lang-switch-wrap list into wp-admin/user-edit.php but am struggling to find out what events to attach to this so that clicking on these flags has an effect. Is there any advice on this?

Additional information: To extend the user profile information I created an ACF field group called "Additional profile information". Under settings->Location Rules, I have "Show this field if" "user form" "is equal to" "add/edit".

This is with ACF Pro 6.0.7, ACF Extended 0.8.9.2, QTtranslate-XT 3.13.0 and Wordpress 6.1.1

herrvigg commented 1 year ago

Duplicate #1285. Please stick to a single thread. Creating a new one won't make it faster, in fact it's making it more difficult as the information must be cross-checked.

herrvigg commented 1 year ago

If I understand right #1285 can be closed for the edit.php part and what remains is only user-edit.php. Yes I changed a few things in 3.13.0 to remove some HTML anchor elements, they were creating additional complications and they should not be necessary. We need a better way.

I can't reproduce the problem, I'm using an older ACF Pro 6.0.2 but this should probably be the same. I don't know if ACF Extended has some impact.

The anchor id for user-edit.php is acf-form-data and I have this right after the Application Passwords:

<div id="acf-form-data" class="acf-hidden">
  <input type="hidden" id="_acf_screen" name="_acf_screen" value="user">
  <input type="hidden" id="_acf_post_id" name="_acf_post_id" value="user_317">
  <input type="hidden" id="_acf_validation" name="_acf_validation" value="1">
  <input type="hidden" id="_acf_nonce" name="_acf_nonce" value="11beb5f33f">
  <input type="hidden" id="_acf_changed" name="_acf_changed" value="0">
</div>

So the LSB are created there. If you find another element you can add the anchor in: https://github.com/qtranslate/qtranslate-xt/blob/ed65ce16c12e2ce61bd1a177d415df9165bf365c/modules/acf/src/qtx_module_acf_admin.php#L139

herrvigg commented 1 year ago

@MarkArgent could you also open a console, run this and give the result?

JSON.stringify(qTranslateConfig.page_config)
herrvigg commented 1 year ago

@MarkArgent Please try again with last release 3.14.0. I will close this ticket if there's no activity.

herrvigg commented 1 year ago

No update so I close this ticket. Re-open if you can provide more relevant data and how to reproduce it.