User saving not working
-
AM using the beta version.
the problem I have now is the user won’t have the ability to save his predictions
what are the expected issues?
-
Note: Am using Brave browser.
What do you mean with “the user won’t have the ability to save his predictions”?
Do you get an error message? Is the save button not working? Can you see anything in the console? Did you try switching off other plugins and changing to a default theme?
Without providing more information on the problem or how to reproduce it, I won’t be able to help.
I did a quick test with the Brave browser but could not find a problem on my dev version.
Hi AntoineH,
Thanks for the fast reply.
used plugins:
1- Football Pool
2- Ultimate MemberThe problem:
1- when the user adds its prediction and saves it “-
no confirmation message shown
“, but the data is saved.
2- When I update the match score no calculation happened :Score and ranking calculation No matches or questions to calculate, or no users in the pool. Ranking cleared.
These is the website details u can test:
https://successota.com/q2/wp-admin
(Removed by moderator)thanks
-
This reply was modified 2 years, 10 months ago by
Yui. Reason: password removed
Please do not post credentials on the forum. I don’t want access to your website.
Then, to give feedback on your problems.
1- when the user adds its prediction and saves it no confirmation message shown, but the data is saved.
This is by design because saving happens on the background via AJAX calls. There is a small ‘animation’ that indicates that an action is taking place.
The latest beta version (uploaded yesterday evening) has an option to go back to using the old form saves instead of the AJAX calls, if you like. But I’ll also think about adding a subtle “saved” message that can be styled via CSS.2- When I update the match score no calculation happened
If you are using the Qatar data, then this is also expected behavior. Because matches are only included in the calculation if they are ‘closed’. Matches in the future are not included in the calculation. So, if you decide to test by entering an end result, then also put the match date in the past, e.g. by changing the year to 2021.
Hello Antoine,
The saving of predictions on the background via AJAX calls is not working in the latest version of the Football Pool (at least with me). You see the Pool is thinking, and then the prediction disappears; a notification appears with the text that something went wrong.
When I then fill in the score, the score stays, and I can manualy save the prediction (via the save button).
The saving via AJAX calls is great… if it’s working ?? Is it possible to disable this? I can’t find it in the backend, in the admin panel, anymore.
@potjekak
If you enable debugging on your website you might be able to get info on what is happening during the AJAX saves. Also the dev tools (network tab) of your browser can sometimes deliver useful insights.AJAX saves can be disabled via the FOOTBALLPOOL_FRONTEND_AJAX constant in the wp-config.
define( 'FOOTBALLPOOL_FRONTEND_AJAX', false );
Thank you for the quick response. I get the following error in de debug:
Column 'home_score' cannot be null bij query INSERT INTO pool_wp_predictions ( user_id, match_id, home_score, away_score, has_joker ) VALUES ( 1, 5, NULL, 0, 0 ) gemaakt door do_action('wp_ajax_footballpool_update_team_prediction'), WP_Hook->do_action, WP_Hook->apply_filters, Football_Pool_Pool::update_prediction
I used Google Chrome and Microsoft Edge. Both of the browsers get the same error.
-
This reply was modified 2 years, 6 months ago by
potjekak.
This is caused by the fact that the update script didn’t successfully run when you upgraded the plugin. If you have access to phpMyAdmin or similar tool, you can run a query on the database to resolve the issue.
ALTER TABLE pool_wp_predictions CHANGE home_score home_score TINYINT UNSIGNED NULL, CHANGE away_score away_score TINYINT UNSIGNED NULL;
Note: if you have a different table prefix, the above statement will fail and you need to change the “pool_wp_” with the correct prefix.
But I also wonder if the other updates to the database succeeded. Did you already finish a calculation? If it gives an error we also need another script to fix that.
No, not finished a calculation yet. It’s for Qatar 2022, so there’s no match yet. When I run the calculation, it also says there’s nog match yet.
But I did run the query in phpMyAdmin, and the AJAX-update works! Yeah! So the solution was to alter the database. Many thanks!
-
This reply was modified 2 years, 6 months ago by
potjekak.
You can do a quick test by changing the year of the first match to 2021. You can change it back to 2022 after the test and when you do a calculation afterwards, it will empty the database.
But I think the calculation will fail. So, maybe it’s best that you run the following query as well. Better safe then sorry ??
DROP TABLE pool_wp_scorehistory_s1_t1; DROP TABLE pool_wp_scorehistory_s1_t2; CREATE TABLE IF NOT EXISTS pool_wp_scorehistory_s1_t1 ( ranking_id INT UNSIGNED NOT NULL, score_order INT UNSIGNED NOT NULL DEFAULT '0', type TINYINT UNSIGNED NOT NULL DEFAULT '0', score_date DATETIME NOT NULL, source_id INT UNSIGNED NOT NULL, user_id INT UNSIGNED NOT NULL, score INT UNSIGNED NOT NULL, full SMALLINT UNSIGNED NOT NULL DEFAULT '0', toto SMALLINT UNSIGNED NOT NULL DEFAULT '0', goal_bonus SMALLINT UNSIGNED NOT NULL DEFAULT '0', goal_diff_bonus SMALLINT UNSIGNED NOT NULL DEFAULT '0', joker_used SMALLINT UNSIGNED NOT NULL DEFAULT '0', total_score INT UNSIGNED NOT NULL DEFAULT '0', ranking INT UNSIGNED NOT NULL, PRIMARY KEY (ranking_id,type,source_id,user_id), KEY ix_ranking_score_order_user (ranking_id,score_order,user_id) USING BTREE, KEY ix_user_id (user_id) USING BTREE, KEY ix_ranking_id (ranking_id) USING BTREE, KEY ix_ranking (ranking) USING BTREE, KEY ix_score_order (score_order) USING BTREE, KEY ix_joker_used (joker_used) ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS pool_wp_scorehistory_s1_t2 ( ranking_id INT UNSIGNED NOT NULL, score_order INT UNSIGNED NOT NULL DEFAULT '0', type TINYINT UNSIGNED NOT NULL DEFAULT '0', score_date DATETIME NOT NULL, source_id INT UNSIGNED NOT NULL, user_id INT UNSIGNED NOT NULL, score INT UNSIGNED NOT NULL, full SMALLINT UNSIGNED NOT NULL DEFAULT '0', toto SMALLINT UNSIGNED NOT NULL DEFAULT '0', goal_bonus SMALLINT UNSIGNED NOT NULL DEFAULT '0', goal_diff_bonus SMALLINT UNSIGNED NOT NULL DEFAULT '0', joker_used SMALLINT UNSIGNED NOT NULL DEFAULT '0', total_score INT UNSIGNED NOT NULL DEFAULT '0', ranking INT UNSIGNED NOT NULL, PRIMARY KEY (ranking_id,type,source_id,user_id), KEY ix_ranking_score_order_user (ranking_id,score_order,user_id) USING BTREE, KEY ix_user_id (user_id) USING BTREE, KEY ix_ranking_id (ranking_id) USING BTREE, KEY ix_ranking (ranking) USING BTREE, KEY ix_score_order (score_order) USING BTREE, KEY ix_joker_used (joker_used) ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
It’s like you’re a wizard ??
When I changed the year, the error appeared when doing the calculation. Just like you said. Then I ran the query above, and all was good again. The calculation worked; no error message.
I changed the year back to 2022 and all problems are solved!
Thank you very much!
-
This reply was modified 2 years, 6 months ago by
potjekak.
-
This reply was modified 2 years, 10 months ago by
- The topic ‘User saving not working’ is closed to new replies.