Error translating with WPML pages that contain form element

Hello,
There is a problem when you try to translate a cornerstone page that contains a Form element.
We are using WPML and CF7, the error:

Se ha producido un error del tipo E_ERROR en la línea 140 del archivo /var/www/xxx/dev2/wp-content/themes/pro/cornerstone/includes/elements/definitions/form-integration.php. Mensaje de error: Uncaught Error: Call to a member function id() on null in /var/www/xxx/dev2/wp-content/themes/pro/cornerstone/includes/elements/definitions/form-integration.php:140
Stack trace:
#0 /var/www/xxx/dev2/wp-content/themes/pro/cornerstone/includes/classes/element/class-element-definition.php(496): x_element_render_form_integration(Array)
#1 /var/www/xxx/dev2/wp-content/themes/pro/cornerstone/includes/classes/element/class-element-definition.php(478): Cornerstone_Element_Definition->render_one(Array)
#2 /var/www/xxx/dev2/wp-content/themes/pro/cornerstone/includes/classes/Elements/Renderer.php(64): Cornerstone_Element_Definition->render(Array)
#3 /var/www/xxx/dev2/wp-content/themes/pro/cornerstone/includes/classes/Elements/Renderer.php(73): Themeco\Cornerstone\Elements\Renderer->renderElement(Array)
#4 /var/www/xxx/dev2/wp-includes/class-wp-hook.php(303): Themeco\Cornerstone\Elements\Renderer->renderElements(Array, A

Hi @llribas,

Thanks for reaching out.
It will be very difficult to recognize the problem without investigating the settings. I would request you please provide login credentials for your site in a secure note to examine it, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password
– Specific page URL where it is happening.
– FTP/CPanel credentials to access the files.

To create a secure note, click the key icon underneath any of your posts.

Thanks

ok, you have the secure note
thank you

Hi @llribas,

I have created a test by duplicating the same content and added the Contact Form 7 using the Form Integration element and found it has been translated properly and working fine. I would suggest you check once by clearing all types of cache and in the incognito/private mode of the browser.

Hope it helps.
Thanks

Yes, but the problem is when you translate a page using cornerstone, with the buttons at the bottom right of the interface (with the language flags). Then, if the page that you are trying to translate has a contact form (or a global block containing a contact form), then it throws the error.
It looks like that:

  • if you have NOT translated the form, it throws the error.
  • if you translated the form BEFORE trying to translate the page that contains the form, then it goes ok.

You must have a look at the situation I describe.

Hello @llribas,

There is comprehensive documentation on how to use Contact Form 7 with WPML, you can refer to the same at: https://wpml.org/documentation/plugins-compatibility/using-contact-form-7-with-wpml/

Please confirm that you have followed the step mentioned in the above tutorial. If not, you may need to refer to the same.

You may need to:

  1. Create a contact form for English page.

  2. Copy the contact form, this will create a duplicate of the contact form for the Spanish page. This will also give a new shortcode to use, which we will use on the Spanish page.

  3. Translate all the things in the Spanish contact form (including error messages in contact form settings). You need to translate the contact form settings and other things from the contact form screen itself, do not use string translation.

  4. Create/Edit a contact page (or any other page) in the English language. Add contact form shortcode (which was at step 1)

  5. Translate the contact page (or any other page) from English to Spanish and add a shortcode of the contact form (Created in step-2). You should mark that this contact page (or any other page) is the translation of the English contact page.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.