Support » Plugin: Loco Translate » “Choose a location” radio buttons are missing

  • Resolved asafmoshejul

    (@asafmoshejul)


    When trying to add a new language, under the “Choose a location” section the radio buttons are missing.

    I see the list “Custom”, “System” and “Author” – but no radio buttons next to them, so I can’t continue.

    What can cause it?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 28 total)
  • Plugin Author Tim W

    (@timwhitlock)

    I can only guess at the cause.

    It’s possible another plugin has loaded CSS styles that are hiding them. Please check if they’re actually present in the document.

    I checked the HTML, the element itself doe’s not exists, it is not a CSS issue.

    What else can cause it?

    Plugin Author Tim W

    (@timwhitlock)

    I can’t think of any way this can happen.

    Have you enabled WP_DEBUG?
    Do you have any errors in your logs?
    Does it happen for all plugins/themes?
    Do the radio buttons appear if you reload the page with JavaScript disabled?
    Have you tried disabling all other plugins one by one?

    Can you please post the full HTML of the admin page into pastebin or something?

    Hi,

    So…

    Do you have any errors in your logs? – Nothing
    Does it happen for all plugins/themes? – Yes
    Do the radio buttons appear if you reload the page with JavaScript disabled? – No. And I get this message “Write protected: Creating this file requires permission. Click “Connect” to authenticate with the server.”. Pressing “connect” nothing happens. I don’t get it with JS enabled.
    Have you tried disabling all other plugins one by one? – Disabled all plugins and switched to stock Storefront – still not showing.

    Any ideas?

    Thanks,
    Asaf

    Plugin Author Tim W

    (@timwhitlock)

    I’m still clueless as to how this can physically happen. A label (e.g. Custom) cannot be present without at least one location also being present. Code here.

    So, something must be breaking during the iteration of these paths, but I cannot begin to guess at what unless you can provide steps to reliably reproduce the issue.

    One thing you didn’t respond to from above: Can you please post the full HTML of the admin page into pastebin or something?

    Sorry, here is the HTML:
    https://pastebin.com/UdKH1ckK

    There are really no steps to reproduce , it just happen each time I try to create a new translation…

    What more information can assist?

    Do you need admin access to the site?

    Plugin Author Tim W

    (@timwhitlock)

    Thanks. It certainly appears that the ‘paths’ array is empty or not iterating. Both are logically impossible. I’m unable to imagine or simulate anything that can could cause this, other than something external stripping content out of the page.

    Sorry, but logging into your server to debug your site is beyond the support I can offer. Whatever is happening does not seem to be normal execution of the code.

    Plugin Author Tim W

    (@timwhitlock)

    If you want to debug this. Dump the $location object from here:
    https://github.com/loco/wp-loco/blob/2.2.0/tpl/admin/init/init-po.php#L108

    So I looked again in the code you sent.

    I did some debugging and concluded that “$location[‘paths’]” is an empty array.

    So the issue must start at line 252 in “InitPoController.php”, starting with this line:

    foreach( $filechoice as $pofile ){

    I hope it helps

    Please see my previous message as well.

    Thanks,
    Asaf

    I have exactly the same issue.

    tried with some themes and the results are the same.

    Another update.

    If I add the simple codeecho "string"; on line 252 on “InitPoController.php”, right before foreach( $filechoice as $pofile ){ – the radio buttons appears.

    What can cause this weird behavior?

    Plugin Author Tim W

    (@timwhitlock)

    I’ve already examined this, which is why I say it’s “impossible” for a label to exist without at least one path. The logic of that statement is as follows:

    When a label is added (line 256) the code continues without breaking to populate the ‘paths’ array (line 296). Hence if a label exists, a path exists.

    I’m unable to simulate any situation where this fails to be the case. As you are able to observe this happening, I can only lave you to find out why. If it’s a bug, I’ll fix it, but I need evidence of a bug.

    I can give you access of the website, if you like

    Plugin Author Tim W

    (@timwhitlock)

    We have messaging overlap. Regarding your last comment.

    What can cause this weird behavior?

    That is very strange indeed. It’s necessary to know whether it is the echoing that changed behaviour, or simply modifying the PHP file. If the latter then possibly related to some kind of opcode cache you’re using.

    What happens when you remove your echo line? Does it remain fixed, or revert?

    Did you see my last message:

    Another update.

    If I add the simple code echo "string"; on line 252 on “InitPoController.php”, right before foreach( $filechoice as $pofile ){ – the radio buttons appears.

    What can cause this weird behavior?

    Anyway, as I mentioned, it is also happening with no other plugins activated and with a stock Storefront theme. So if it is not a bug it is at least bad error catching of server settings issue.

    If it happened to me (again, with no other plugins or custom code) I guess it can happen to others. Therefore, the plugin might benefit from understanding the issue.

Viewing 15 replies - 1 through 15 (of 28 total)
  • You must be logged in to reply to this topic.