This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 14 replies, has 2 voices.

Last updated by Bobby 1 year ago.

Assigned support staff: Bobby.

Author Posts
September 28, 2018 at 6:39 pm

tedM-4

I am trying to: Add a language switcher to the main menu.

Link to a page where the issue can be seen:hidden link

I expected to see:

Instead, I got:It seems no switcher is installed but if I add one the site freezes. I see an English and French on the menu page but if I try to add sometimes the English will add, never the french and other times it just hangs.

September 28, 2018 at 7:28 pm #2774738

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

Please go to WPML->languages->Add menu language switcher.

once added from within there , check the front end and let me know your results

October 1, 2018 at 6:24 am #2777190

tedM-4

I tried it and the front end freezes. The featured picture and title appear but no menus and the page is non responsive to clicking on it or scrolling. It is frozen.

October 1, 2018 at 11:33 pm #2779641

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

I would need to see the detail of the error log. You can see how to enable debug logging here:
https://wpml.org/documentation/support/debugging-wpml/

Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:
define('WP_DEBUG', true);

Edit your wp-config.php file and add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

This will create an error_log.txt file in your site's root directory. Please send me its contents.

October 2, 2018 at 12:20 pm #2781378

tedM-4

I made the changes to wp-config.php files but can not locate the error_log.txt file in the root directory.

October 2, 2018 at 12:42 pm #2781416

tedM-4

I found it. How do I send you the file?

October 2, 2018 at 7:35 pm #2782582

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

i have enabled the private field reply, so only you and i will have access to the file

you can send it with dropbox , wetransfer, Google Drive or your prefered service 🙂

thank you !

October 4, 2018 at 2:47 am
October 4, 2018 at 7:22 pm #2788670

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

thank you for the error log.

within the error log i can see that the wp_options table is reportedly missing from your Database.

if possible please verify this , and also if you can install the plugin Adminer ARI in your site so i can take a closer look within your database, as i currently do not have access to install it.

thank you !

October 5, 2018 at 2:49 am #2789469

tedM-4

I installed the plug in but do not know about the wp_options table.

Thanks!!

October 5, 2018 at 9:51 pm #2791754

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

Please review the following error

[02-Oct-2018 12:17:51 UTC] WordPress database error Table 'tedsa816_wp568.wptt_3_options' doesn't exist for query SELECT option_value FROM wptt_3_options WHERE option_name = 'wptt_3_user_roles' LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), do_action('template_redirect'), WP_Hook->do_action, WP_Hook->apply_filters, Mlp_Redirect_Response->redirect, Mlp_Language_Negotiation->get_redirect_match, Mlp_Language_Negotiation->get_redirect_targets, Mlp_Language_Negotiation->get_translations, Mlp_Language_Api->get_translations, switch_to_blog, do_action('switch_blog'), WP_Hook->do_action, WP_Hook->apply_filters, wp_switch_roles_and_user, WP_Roles->for_site, WP_Roles->get_roles_data, get_option
[02-Oct-2018 12:17:51 UTC] WordPress database error Table 'tedsa816_wp568.wptt_3_options' doesn't exist for query SELECT option_value FROM wptt_3_options WHERE option_name = 'icl_sitepress_settings' LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), do_action('template_redirect'), WP_Hook->do_action, WP_Hook->apply_filters, Mlp_Redirect_Response->redirect, Mlp_Language_Negotiation->get_redirect_match, Mlp_Language_Negotiation->get_redirect_targets, Mlp_Language_Negotiation->get_translations, Mlp_Language_Api->get_translations, switch_to_blog, do_action('switch_blog'), WP_Hook->do_action, WP_Hook->apply_filters, SitePress->init_settings, get_option
[02-Oct-2018 12:17:51 UTC] WordPress database error Table 'tedsa816_wp568.wptt_3_options' doesn't exist for query SELECT option_value FROM wptt_3_options WHERE option_name = 'active_plugins' LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), do_action('template_redirect'), WP_Hook->do_action, WP_Hook->apply_filters, Mlp_Redirect_Response->redirect, Mlp_Language_Negotiation->get_redirect_match, Mlp_Language_Negotiation->get_redirect_targets, Mlp_Language_Negotiation->get_translations, Mlp_Language_Api->get_translations, switch_to_blog, do_action('switch_blog'), WP_Hook->do_action, WP_Hook->apply_filters, WPML_ST_Multisite_Filters_Cleaner->handle_filters, is_plugin_active, get_option

within your theme's file 'wp-blog-header.php it seems that its calling to the database table wp_option but its looking for the database under the name wptt_3_options and your database is named wptt_options

is it possible there has been a mix up in your configuration regarding the DB name ?

i have tried reviewing your theme files and your wp-config.php file but i am not able to login using the credentials above for the FTP.

October 6, 2018 at 1:08 pm #2792815

tedM-4

I originally installed Polylang but did not like it and switched to WPML. Is it possible it left something behind when I deleted it. Here are the credentials for the FTP. The password is the same.

FTP Username: quescouts@quescouts.ca
FTP server: hidden link
FTP & explicit FTPS port: 21

October 6, 2018 at 2:13 pm #2792872

tedM-4

Oddly I can only find wptt_4_options in the database?? not wptt_3_options or wp_option.

How can I reconfigure so is goes to the right database? i hope you can get in to the FTP now. here are the contents of the wp-config.php file

/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://codex.wordpress.org/Editing_wp-config.php
*
* @package WordPress
*/

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'tedsa816_wp568');

/** MySQL database username */
define('DB_USER', 'tedsa816_wp568');

/** MySQL database password */
define('DB_PASSWORD', 'e2I)p(5S3u');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link hidden link WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'uqgffcz8xan43afkknxxoibat2oyigahdcfqxkftcrdyqoh0onhmz4ekbkl5s1jj');
define('SECURE_AUTH_KEY', 't01vzktrequh9iffhhuojhmrdfoifcm5ian3f5ofedzjf75xzeiosgaagbmo0tql');
define('LOGGED_IN_KEY', 'hyfdq2rhnjhzelvsl1xjce3dkhodrb95bkxrnfmiels9qtrs7vswdhhktgv81ksa');
define('NONCE_KEY', 'fcqftoafehjywpzh5dhvhjsev3fnmtyqroiks8gjgdmy6ecqwmlv7yzkbiwbj4bw');
define('AUTH_SALT', 'h6rignjv30hgyzrz9ebzboxyhihazincmvfwcybx3iigfvntpf0pmrtuwlpqklkp');
define('SECURE_AUTH_SALT', 'mkxuh0brv6zodo79aopqbys9mpjd7q29ex9hbz2metbvmmehtwtubojxgrtdczwm');
define('LOGGED_IN_SALT', 'yztg9tx3vx47gl83knh1ijol44gqalnqk6cxvdzccjhdshetxegvouosueupswgt');
define('NONCE_SALT', 'ukyzhlssn43i24tazl6w9go9iwkqbytljssrqu7hk6xs8xoojrb6jvuom22qt8bi');

/**#@-*/

/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wptt_';

/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
* @link https://codex.wordpress.org/Debugging_in_WordPress
*/
define('WP_DEBUG', false);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'quescouts.ca');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define('WP_MEMORY_LIMIT', '128M');

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

October 8, 2018 at 8:01 pm #2797216

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

i was able to examine your wp-config.php and it is pointing to the correct database..additionally i can confirm now that the behavior you are experiencing is from the way the theme has been coded as the original twenty17 theme will not cause any problems when tested locally but it seems that some custom code within your theme might be triggering this action when the language switcher is added.

to resolve this i did the following.

i went to wp-content/themes/twenty-seventeen/header.php/ and added a custom language switcher using the following code on line '37'

do_action('wpml_add_language_selector');

when adding the custom language switcher you can style it from within WPML->Languages->Custom Language switcher->Customize

and also add your own CSS to style it additionally in the front end.

the custom language switcher is working as expected in the front end.

-> https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/#custom-locations

October 9, 2018 at 12:42 am #2797619

tedM-4

Thanks. It is working as it should. I really appreciate your help.