Jack-Dane / odoo-wp-plugin

Odoo WordPress Plugin
GNU General Public License v3.0
8 stars 4 forks source link

I cannot validate the creation of a form #17

Closed shareyourtrip closed 11 months ago

shareyourtrip commented 1 year ago

The connection to Odoo works perfectly but when I want to create my form nothing happens when I click on the submit button.

Capture d’écran 2023-10-01 à 12 06 46

Platform versions:

Jack-Dane commented 1 year ago

Thanks for opening an issue for your problem.

Do you mind sharing with me the JS console after you have clicked the submit button?

shareyourtrip commented 1 year ago

Hello, thanks for the help. Nothing happen when I click on the submit button. But before there are theses errors :

Capture d’écran 2023-10-01 à 13 13 49

Incorrect use of

Jack-Dane commented 1 year ago

Unfortunately, I cannot see any labels that don't correctly correlate to an ID present on the form.

What browser + version are you using? I will try to reproduce the issue on my machine.

Chrome + 117.0.5938.132 shows no errors. I have also tried Edge + Firefox.

shareyourtrip commented 1 year ago

I also use Chrome 117.0.5938.132 version. I have also tried on Safari, same issue. Should it show JS informations when clicking on submit button ?

Jack-Dane commented 1 year ago

Hmm, I wonder if it has something to do with browsers on macOS.

No, you shouldn't see anything, but you would likely see errors there if you aren't able to submit a new form.

Because it sends a fetch request to the API to make the record.

shareyourtrip commented 1 year ago

Hello, I just try with a windows computer and it still doesn't work

Jack-Dane commented 1 year ago

I apricate you taking the time to help me debug this issue.

I have just tried on windows (was trying Ubuntu originally) but I still cannot replicate this unfortunately.

Lets confirm a few more things:

shareyourtrip commented 1 year ago

Thank you for your time because your extension could be very useful to us!

What version of the plugin are you using? The version is Version 0.0.3

How did you install the plugin? Did you use composer or download from the release page? I installed the plugin simply by importing it via Filezilla after downloading from the release page.

Do you have any errors in the WordPress logs? [01-Oct-2023 09:46:08 UTC] WordPress database error Table 'mabe6690_wp553.wpyy_odoo_conn_form_mapping' doesn't exist for query SELECT wpyy_odoo_conn_form_mapping.id, wpyy_odoo_conn_form_mapping.odoo_form_id, wpyy_odoo_conn_form.name as 'odoo_form_name', wpyy_odoo_conn_form_mapping.cf7_field_name, wpyy_odoo_conn_form_mapping.odoo_field_name, wpyy_odoo_conn_form_mapping.constant_value FROM wpyy_odoo_conn_form_mapping JOIN wpyy_odoo_conn_form ON wpyy_odoo_conn_form_mapping.odoo_form_id=wpyy_odoo_conn_form.id ORDER BY wpyy_odoo_conn_form_mapping.id DESC LIMIT 11 OFFSET 0 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, odoo_conn\admin\api\endpoints\odoo_conn_get_odoo_from_mappings, odoo_conn\admin\api\endpoints\OdooConnGetBaseSchema->request

Do you have any plugins installed on your browser? Sometimes they can interfere unexpectedly. Advanced Order Export For WooCommerce | Version 3.4.2 par AlgolPlus | Mises à jour auto désactivées Akismet Anti-spam: Spam Protection | Version 5.3 par Automattic - Anti-spam Team | Mises à jour auto désactivées Alma Monthly Payments for WooCommerce | Version 1.3.1 par Alma | Mises à jour auto désactivées Check & Log Email | Version 1.0.7 par WPChill | Mises à jour auto désactivées Checkout Field Editor for WooCommerce | Version 1.9.1 par ThemeHigh | Mises à jour auto désactivées Contact 7 to Odoo connector | Version 0.0.3 | Mises à jour auto désactivées Contact Form 7 | Version 5.8.1 par Takayuki Miyoshi | Mises à jour auto désactivées Divi Coming Soon | Version 1.0.1 par Divi Life — Tim Strifler | Mises à jour auto désactivées Divi Map Extended Module | Version 3.1.4 par Divi Web Design | Mises à jour auto désactivées Enable Media Replace | Version 4.1.4 par ShortPixel | Mises à jour auto désactivées FunnelKit Automations | Version 2.6.1 par FunnelKit | Mises à jour auto désactivées Google Listings and Ads | Version 2.5.7 par WooCommerce | Mises à jour auto désactivées GTM4WP | Version 1.18.1 par Thomas Geiger | Mises à jour auto désactivées Hotjar | Version 1.0.15 par Hotjar | Mises à jour auto désactivées HubSpot All-In-One Marketing - Forms, Popups, Live Chat | Version 10.2.5 par HubSpot | Mises à jour auto désactivées Kadence WooCommerce Email Designer | Version 1.5.11 par Kadence WP | Mises à jour auto désactivées Meta pixel for WordPress | Version 3.0.13 par Facebook | Mises à jour auto désactivées myStickymenu | Version 2.6.4 par Premio | Mises à jour auto désactivées Order Export & Order Import for WooCommerce | Version 2.3.9 par WebToffee | Mises à jour auto désactivées PDF Invoices & Packing Slips for WooCommerce | Version 3.6.3 par WP Overnight | Mises à jour auto désactivées Pinterest for WooCommerce | Version 1.3.10 par WooCommerce | Mises à jour auto désactivées PixelYourSite | Version 9.4.6 par PixelYourSite | Mises à jour auto désactivées Plugin for Google Reviews | Version 2.8 par RichPlugins support@richplugins.com | Mises à jour auto désactivées Product Configurator for WooCommerce | Version 1.2.53 par Marc Lacroix | Mises à jour auto désactivées Product configurator for WooCommerce addon - Conditional logic | Version 1.2.10 par Marc Lacroix | Mises à jour auto désactivées Product configurator for WooCommerce addon - Extra price | Version 1.1.11 par Marc Lacroix | Mises à jour auto désactivées Redirection | Version 5.3.10 par John Godley | Mises à jour auto désactivées Sequential Order Numbers for WooCommerce | Version 1.5.5 par WebToffee | Mises à jour auto désactivées Spotlight - Social Media Feeds | Version 1.6.4 par RebelCode | Mises à jour auto désactivées Titan Anti-spam & Security | Version 7.3.5 par CreativeMotion | Mises à jour auto désactivées WooCommerce | Version 8.1.1 par Automattic | Mises à jour auto désactivées WooCommerce Google Analytics Integration | Version 1.8.5 par WooCommerce | Mises à jour auto désactivées WooCommerce Shipping & Tax | Version 2.3.5 par WooCommerce | Mises à jour auto désactivées WooCommerce Stripe Gateway | Version 7.6.0 par WooCommerce | Mises à jour auto désactivées WPS Hide Login | Version 1.9.9 par WPServeur, NicolasKulka, wpformation | Mises à jour auto désactivées WP Table Builder | Version 1.4.11 par WP Table Builder | Mises à jour auto désactivées Yoast SEO | Version 21.2 par Team Yoast | Mises à jour auto désactivées

Could you show the network tab in your browser? When you load the page and when you have clicked on the button. There should be a new network request as soon as you click the submit button. Nothing happened

Capture d’écran 2023-10-02 à 18 52 14
Jack-Dane commented 1 year ago

That WordPress error is rather strange. The table is created on activation. I wonder why WordPress is complaining it doesn't exist.

It shouldn't be linked to the form page. I tried to replicate this issue by deleting that table, but still no luck. If the form table doesn't exist and I try to create a record it fails.

Could you confirm that these tables exist within the backend database?

  1. odoo_conn_connection
  2. odoo_conn_errors
  3. odoo_conn_form
  4. odoo_conn_form_mapping - probably doesn't if WP is complaining about it.

The could be any string (looks like it might be wpyy_ in your database).

I would suggest if any of the tables don't exist, try to reactivate the plugin. This should recreate the tables, if it doesn't could you put any WP errors that you see on activation in the next comment, please?

JulesNdanga commented 1 year ago

Hello @shareyourtrip, Before installing the plugin, did you run composer install?

shareyourtrip commented 1 year ago

Hello @shareyourtrip, Before installing the plugin, did you run composer install?

No and I admit I don't know what is "composer", I perhaps naively thought that by uploading the file via FTP it would work. Is this step obligatory? Sorry @Jack-Dane I don't answer your last questions but this may be my problem. How should I go about composing?

Jack-Dane commented 1 year ago

@JulesNdanga, thanks for trying to help with this issue.

@shareyourtrip, as you described downloading the plugin from the release page (new feature) in your previous comment, you shouldn't need to use Composer before installing the plugin.

You only need to use composer when installing from the source code.

It is also unlikely that Composer is the issue as you can test the connection, which is only possible by installing the XML-RPC library with Composer.

I would be keen to see the answers to this to know what is really going on here: https://github.com/Jack-Dane/odoo-wp-plugin/issues/17#issuecomment-1745077907

shareyourtrip commented 1 year ago

That WordPress error is rather strange. The table is created on activation. I wonder why WordPress is complaining it doesn't exist.

It shouldn't be linked to the form page. I tried to replicate this issue by deleting that table, but still no luck. If the form table doesn't exist and I try to create a record it fails.

Could you confirm that these tables exist within the backend database?

  1. odoo_conn_connection
  2. odoo_conn_errors
  3. odoo_conn_form
  4. odoo_conn_form_mapping - probably doesn't if WP is complaining about it.

The could be any string (looks like it might be wpyy_ in your database).

I would suggest if any of the tables don't exist, try to reactivate the plugin. This should recreate the tables, if it doesn't could you put any WP errors that you see on activation in the next comment, please?

I have 3 odoo tables in the database :

Capture d’écran 2023-10-03 à 17 46 43

I also deactivated and reactivated the plugin but it still does not work when I want to add a form (the connection works perfectly) and no new table has been created in the database. No new WP errors

Jack-Dane commented 1 year ago

Thanks @shareyourtrip, I think this is the problem then.

It creates the odoo_conn_connection table first, so if it fails on odoo_conn_form it would explain why there is still the connection table:

function odoo_conn_activation_function()
{
    require_once(ABSPATH . "wp-admin/includes/upgrade.php");
    odoo_conn_create_odoo_connections_table();
    odoo_conn_create_odoo_form_table();
    odoo_conn_create_odoo_form_field_mapping();

    update_option("odoo_conn_db_version", 1);
}

Without an error log, this might not be so easy, but I can make one assumption.

Since the form table references another table, does the table: wpyy_posts exist in your WP database?

This should be where blog posts are, but maybe it has a different name in your WordPress instance?

Jack-Dane commented 1 year ago

@shareyourtrip, I was able to replicate this issue by changing the wp_posts table name and activating the plugin. I could create a connection, and test it, but couldn't create a form. It also had the same tables missing as yours.

I thought in my implementation that the posts table wouldn't have a different name, but it appears there are cases where this is the case.

I will start to implement a solution that should hopefully take into account a posts table that isn't named posts.

Jack-Dane commented 1 year ago

@shareyourtrip, I have made a new release to fix this issue.

Please give 0.0.4 a try.

shareyourtrip commented 1 year ago

Hello @Jack-Dane thank you for the new release. Unfortunatly it still doesn't work, I checked in filezilla that the files were updated.

Capture d’écran 2023-10-05 à 10 09 44

I also checked the database and it is still missing.

Capture d’écran 2023-10-05 à 09 37 33
Jack-Dane commented 1 year ago

@shareyourtrip, unfortunately without more information I won't be able to know what is causing the plugin to not work for you.

I assume that you reactivated the plugin when you uploaded the new version?

The release is still an improvement as it does support differing table names for wp_posts, did you see wpyy_posts as a table in your database? https://github.com/Jack-Dane/odoo-wp-plugin/issues/17#issuecomment-1745279109

I can guess that the MySQL database tables are configured with MySAM, I don't think it supports foreign keys. It should tell you in one of the settings on the phpmyadmin. If this is the case, I will need to mention there is only support for InnoDB storage engine type.

shareyourtrip commented 1 year ago

Hello, thanks again for your time. Yes the table wpyy_posts has been created. I have reactivated the plugin when I uploaded the new version. I don't understand the last part of your response, sorry 😅

shareyourtrip commented 1 year ago
Capture d’écran 2023-10-06 à 16 20 33
Jack-Dane commented 1 year ago

I have had some problems in the past with tables using MyISAM and creating relationships between tables, but I updated my local configuration to use this and it still installed fine, so that isn't the problem.

Screenshot from 2023-10-06 21-28-46

(See type column, I was originally using InnoDB).

That was the last thing I thought might be going wrong, I am out of ideas on what is causing the tables not to be created for you.

Jack-Dane commented 11 months ago

I will close this issue, it hasn't been worked on in a while and I haven't seen anyone able to reproduce it either.