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 11 replies, has 2 voices.

Last updated by Andreas W. 1 month ago.

Assigned support staff: Andreas W..

Author Posts
September 10, 2019 at 9:22 pm #4548949

Philippe

Tell us what you are trying to do?
The site uses Divi + Pods + Advanced Custom Field (ACF) + FacetWP for product filtering + Woocommerce. The site is in French and in English and all was working fine until one of the update on the site (your plugin or another, I'm not sure since the site as been broken for some time and I just restarted working on it).

The problems are with custom post type for 2 sections of the site (see link to video).

Is there any documentation that you are following?
All was working fine and this is not my first site using WPML.

Is there a similar example that we can see?
hidden link
hidden link

What is the link to your site?
See previous answer

I have create a dev site where I could give you by PM the login info if you need them.

The video I created explaining the situation is at:
hidden link

Thanks for your help 🙂

Philippe

September 11, 2019 at 1:37 pm #4553795

Philippe

Sorry, I forgot to give you the access to the site. They are included in my other ticket (https://wpml.org/forums/topic/one-product-field-stock-in-french/)! My bad!

September 11, 2019 at 4:19 pm #4555255

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you for contacting the WPML Support Forum.

Could you please disable WordFence in the meantime, as my access to the site has been blocked.

Leave me a short notification once the plugin is disabled.

Kind regards
Andreas

September 11, 2019 at 4:52 pm #4555377

Philippe

Sorry about that! Wordfence is now deactivated

September 12, 2019 at 12:31 am #4556863

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

As far I can see the Pods Admin Plugin is responsible for the custom post type "Recipes" and for the custom fields included in those custom posts.

In fact the slug for the costom post type is translated and the translation options for the custom fields do show up and have been set to copy or translate respectively.

Now, in order for the recipes to appear, they will only need to be translated but there are some issues.
I first tried to connect the existing recipes, but I did not get any option to select from. Then I translated using the WPML Translation Editor and the translation worked. Only the ingdients are not showing up inside of the WPML Translation Editors.
After completing the translation the translation jobs was not able to get finished and keeps loading.

Would it be possible to disable plugins and change the theme for a few moments on your live site, in order to test if some other components are cuasing issues?

If not realted to another plguin, it might be that there is a compatilbity issue between the Pods Admin plugin and WPML only.

I have to apologize the delay but I was handling a heavy queue today. I have created a test-site and installed Pods Admin.

Could you please create a simple example of a CPT and include some custom fields to test if we expereince the same issue on a fresh install?

One Click Login: hidden link

Further, while debugging this afternoon I realized the Classic Translation Editor switched to the Advanced Translation Editor. Did you take changes on those options today?

If so, please take note that the Advanced Translation Editor will not currenlty on the test site. Please test here for now using the Classic Translation Editor.

Let me know about the outcome.

Kind regards
Andreas

September 12, 2019 at 2:42 pm #4561925

Philippe

Hi,

I just tried disabling all the plugin except Pods WPML and ACF and still the same issue. I know that it did work flawlessly when the site was new. From what you tried , it looks that all the custom pots fields from Pods are OK but it's all the one added using ACF that are not translatable. As an example for recipes, only ingredients are repeater fields from ACF and the rest are from Pods so that's why I think it might be a problem between WPML and ACF. What do you think?

Yes, I did try the Advanced Translation Editor because I was trying to figure this out but I switched it back to the Classic one.

You don't need to create a test site as the login I gave you is on my dev server and not the live site so you can break it as much as you want. Using BackupBuddy I can simply restore the db or files or the entire site in a mater of minutes plus I have both backups (the db and the complete site) on my PC so if all break I can just re-upload and reinstall.

So the site at hebpro.com/dev/fkaiser is the dev site you can break
The live site is at hidden link and you don't have access to this one.

Thanks for your help, it's really appreciated 🙂

Philippe

September 13, 2019 at 1:56 am #4564557

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Do you have any idea why there comes the message "Préparation is empty" when trying to update the recipes page in French?

I see the custom field is set as requiered. Anyhow the field has a value. FOr testing I have now disabled the "requiered" setting and anyhow the error still appears.

I have applied the necessary settings in order to translate the Advanced Custom Fields (Ingredients) but I was hoping to be able to update the page in order for the WPML to recognize edits on those fields and to check if those fields appear on the editor.

For now, I would advise you to simply translate the ACF Ingredients manually if you create more recipes. In order to do this go to the French recipes page and switch the language in the top admin bar to English. The translation for the Fonue is actually working now:

hidden link

Now, I asked to recreate the issue, to make sure if the issue also exists on a new install. In this case we do have a compatiblity team who will inspect the issue further and work with the different plugin authors in order to solve the issue.

I have created a test site, added Pods Admin, recreated the post type and fields and added ACF Pro, sadly not the latest version, but also here I created the custom repeater field.

I did not change anything on the template files in order for the fields to show up on front-end yet, but ther ewas not a problem with the translations so far. Only the integers for amount of persons or time for preparation did not show up in the editor, but they been copied automatically to the translation.

You can see the test site here:
One Click Login: hidden link

I would like to run a debug on your site tomorrow, to see f we find any PHP errors or database issues and I will be in contact after. I hope this is alright for you?

Kind regards
Andreas

September 13, 2019 at 2:09 pm #4569267

Philippe

Hi Andreas,

I don'T know why it says the field Préparation is always empty, I have set it to not required and now it look like it's working! I will try to do a db repair from WHM.

The recipe work in English but for the French one, I see nothing on the page 🙁

Yes, you can run a PHP chek

Thanks for your help 🙂

September 13, 2019 at 2:24 pm #4569393

Philippe

Hi,

I just noticed that if I put the Preparation in English and save then (on the English recipe) it work but as soon as I save the French version it copies the French Préparation to the English recipe even if the filed is set to Translate! I have done the db repair but it did not change anything 🙁

September 13, 2019 at 5:42 pm #4570269

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I can see that the ingredients are now translatable.

Then I see that the code module used on Div Builder for the products page is not getting translated.

The page shows the following errors:

Notice: Use of undefined constant php - assumed 'php' in /home/hebproc/public_html/dev/fkaiser/wp-content/plugins/divi-mobile-menu/mobile-menu-divi.php on line 17

Notice: ob_end_flush(): failed to send buffer of zlib output compression (0) in /home/hebproc/public_html/dev/fkaiser/wp-includes/functions.php on line 4339

It seems here is a constat issue on the side of the Divi Builder. More about that later.

Further, the [recettes_grid] shortcode from the Recipes page also seems not to be translated properly. May I ask how this shortocde has been generated?

The page shows the following error:
Notice: Use of undefined constant guid - assumed 'guid' in /home/hebproc/public_html/dev/fkaiser/wp-content/themes/fkaiser/functions.php on line 197

Please check the code line. it seems the constant is not declared correctly in your theme´s functions.php file line 197.

Take note that the Divi parent theme is outdated whihc also counts for the Divi Builder.

I would adivse you to update the Divi Theme to the latest version, as your child theme gathers data from here and possible errors in regards to the Divi Builder might have been solved in the altest version. Changes in the child theme will not be affected from this update.

Then, please test if the issue is solved. In case not please use the following test-site to recreate the issue:

One Click Login: hidden link

We have to determine of the issue appears only on your site or even on a new install, in order for further escalation to our developers.

Kind regards
Andreas

September 13, 2019 at 7:40 pm #4570537

Philippe

Hi Andreas,

I have made the code to generate the short codes. All was fine to start with so a plugin or Divi must have changed something in an update.

Here is the code for the short codes code in the sub theme functions.php ( for the home messages, the recipes and the job offer section that all seem to suffer from the same problem):

// Special messages to display on the home page
function pb3d_home_messages(){
$pb3d_nombre_message_afficher = 0; // Compteur pour savoir s'il y a des messages à afficher
$pb3d_messages_to_display = "<li class='le-message'>";
$pb3d_affiche_message = false; // If the message should be displayed (in accordance to the choice of start and end date)

// Function to calculate if the message date is in between the start and end date
function dateIsInBetween(\DateTime $from, \DateTime $to, \DateTime $subject)
{
return $subject->getTimestamp() >= $from->getTimestamp() && $subject->getTimestamp() <= ($to->getTimestamp()) ? true : false;
}

// Get only the message for the home page
$pb3d_messages_accueil = new WP_Query(array(
'post_type' => 'messages_du_site',
'post_status' => 'publish',
'name' => 'message-accueil',
));

while($pb3d_messages_accueil->have_posts()) : $pb3d_messages_accueil->the_post();
$rows = get_field('les_messages_accueil');

if($rows) {
foreach($rows as $row) {
if (is_array($row['message_visible'])) { // Check if the message is marked as visible
if ($row['date_affichage_debut'] == "" && $row['date_affichage_fin'] == "") {
$pb3d_affiche_message = true; // Display the message is enabled and no start - end date are set
} else { // A start and or end date is set
$today = new \DateTime('now', new \DateTimeZone( 'EST' ));
$message_debut = new \DateTime($row['date_affichage_debut'], new \DateTimeZone( 'EST' ));
$message_fin = new \DateTime($row['date_affichage_fin'], new \DateTimeZone( 'EST' ));
dateIsInBetween($message_debut, $message_fin, $today) ? $pb3d_affiche_message = true : $pb3d_affiche_message = false;
}

if($pb3d_affiche_message == true) {
$pb3d_messages_to_display .= $row['le_message'];
$pb3d_nombre_message_afficher += 1;
each($rows) ? $pb3d_messages_to_display .= "<li class='le-message'>" : $pb3d_messages_to_display .= ""; // This is not the last item so we open the div for the next item
}
}
}
if($pb3d_nombre_message_afficher != 0){ // There are messages to display so we enclose the messages in the container div
$the_messages = "<div class='home-messages'>";
$the_messages .= $pb3d_messages_to_display;
$the_messages .= "</div>";
$the_messages .= "<h1>Nombre de messages à afficher : ".$pb3d_nombre_message_afficher."</h1>"; // FOR TESTING ONLY - REMOVE BEFORE LIVE !!!!!
}
}

endwhile;
wp_reset_query();
return $the_messages;
}

add_shortcode('home_messages', 'pb3d_home_messages');

function pb3d_offre_demploi() {
$pb3d_offre_emploi = new WP_Query(array(
'post_type' => 'offredemploi',
'post_status' => 'publish',
'name' => 'offres-demploi'
));

if( !$pb3d_offre_emploi->have_post() ) { $pb3d_offre_emploi->the_post();
$offre_compteur = 0; // If there is no offer or all the offer have visibility unchecked
if( have_rows('les_offres_demploi') ) {

$loffre = '<h2 class="job_h2_title">' . __('We Are Presently Looking For: ', 'Divi') . '</h2>';

while( have_rows('les_offres_demploi') ){ the_row();

$emploi_title = get_sub_field('titre_de_lemploi');
$emploi_description = get_sub_field('description_du_poste');
$emploi_exigences = get_sub_field('exigences_du_poste');
$emploi_type = get_sub_field('type_demploi');
$emploi_heures = get_sub_field('nombre_dheures');
$emploi_salaire = get_sub_field('salaire');
$emploi_visible = get_sub_field('offre_visible');

$loffre .= '<div class="emploi_content">'; // Open the content DIV

if( $emploi_visible ){ // If the visibility is checked then we display the job offer
$offre_compteur = 1; // There is at least one offer so we make sure the "No job offer at the moment!" message is not displayed

$loffre .= '<div class="emploi_title">' . $emploi_title . '</div>';

if( $emploi_description !== "" ) {
$loffre .= '<div class="emploi_description"><div>' . __('Description', 'Divi') . '</div>' . $emploi_description . '</div>';
}
if( $emploi_exigences !== "" ) {
$loffre .= '<div class="emploi_description"><div>' . __('Requirements', 'Divi') . '</div>' . $emploi_exigences . '</div>';
}
if( $emploi_heures !== "" || $emploi_salaire !== "" ){
$loffre .= '

    ';
    if( $emploi_heures !== "" ) $loffre .= '

  • ' . $emploi_heures . '
  • ';
    if( $emploi_salaire !== "" ) $loffre .= '

  • ' . $emploi_salaire . '
  • ';

    $loffre .= '

';
}
}
$loffre .= '</div>';
}
}

if( $offre_compteur == 0 ) {
$loffre = '<h2 class="job_h2_title">' . __('No job offer at the moment!', 'Divi') . '</h2>';
}
}

wp_reset_query();
return $loffre;
}

add_shortcode('offre_emploi', 'pb3d_offre_demploi');

// Create the recettes grid
function pb3d_recettes_grid(){
$pods = pods('recettes');
$params = array(
'limit' => 10
);
$pods->find($params);

$recettes_grid = '<div class="recettes-grid-container">';

while ($pods->fetch()){
if ($pods->field( 'post_title' ) != ""){
$photos = $pods->field('photos', false); // Get the "photos" array
$photos_url = $photos[0][guid]; // Get the first image URL in the array
$photos_src = pods_image_url($photos_url, $size = 'thumbnail'); // Create the thumbnail version of the image
if ($photos_src == "") $photos_src = get_stylesheet_directory_uri() . "/images/recettes-default.jpg"; // There is no recipe image so a default one is used

$recettes_grid .= '<div class="recettes-grid-item et_pb_portfolio_item et_pb_grid_item">';
$recettes_grid .= '<span class="recettes-image et_portfolio_image"><a href="' . $pods->display( 'permalink' ) . '" title="' . $pods->display( 'post_title' ) . '"><img src="' . $photos_src . '" alt="' . $pods->display( 'post_title' ) . '" /><h3 class="recettes-title">' . $pods->display( 'post_title' ) . '</h3><span class="et_overlay"></span></a></span>';
//$recettes_grid .= '<h3 class="recettes-title">' . $pods->display( 'post_title' ) . '</h3>';
$recettes_grid .= '</div>';
}
}

$recettes_grid .= '<div class="recettes_pagination">' . $pods->pagination( array( 'type' => 'advanced')) . '</div>';
$recettes_grid .= '</div>';
return $recettes_grid;
}
add_shortcode('recettes_grid', 'pb3d_recettes_grid');

I will update the theme this weekend and do further testing.

Thanks again, your help is really appreciated 🙂

Philippe

September 16, 2019 at 7:01 pm #4583515

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

The wp-admin for the test site currenlty ends in a 404 error. Could you please verify and send me a notification once the site is ready again?

Could you please try to translate the [recettes_grid] shortcode manually, by going to the page editor and switching the language in the top admin bar? Now, pleace the shortocode into the translated page element respectively.

Does the translation show up?

Now, in regards to the created shortcode, we do consider this as custom coding and our support does sadly not cover such issues.
https://wpml.org/purchase/support-policy/

I would like to advise you to reach out to one of our contractors for further assistance in regards to this issue.
https://wpml.org/contractors/

For the html markup placed in the Divi Code Module I would like to test, if I can recreate the same issue on a new WordPress install. This is mandatory for investigating compatibility issues and for further escalating to our compatiblity team.

Please install Divi in its latest version here. if you find the time, please test and let me know if the Divi Code Module is translatable. Otherwise, leave me a short notification and I will recreate the issue.

One Click Login: hidden link

Kind regards
Andreas

The topic ‘[Closed] 2 sections have broken translation’ is closed to new replies.