• I had an issue trying to submit a CF7 form and narrowed it down to my select field with a list of countries. I raised the issue with CF7 but on further review, we discovered the issue is with CF7DB

    My select list:

    [select address-country id:address-country class:form-field include_blank “Afghanistan” “Albania” “Algeria” “American Samoa” “Andorra” “Angola” “Anguilla” “Antarctica” “Antigua and Barbuda” “Argentina” “Armenia” “Aruba” “Australia” “Austria” “Azerbaijan” “Bahamas” “Bahrain” “Bangladesh” “Barbados” “Belarus” “Belgium” “Belize” “Benin” “Bermuda” “Bhutan” “Bolivia” “Bonaire, Sint Eustatius and Saba” “Bosnia and Herzegovina” “Botswana” “Bouvet Island” “Brazil” “British Indian Ocean Territory” “Brunei Darussalam” “Bulgaria” “Burkina Faso” “Burundi” “Cabo Verde” “Cambodia” “Cameroon” “Canada” “Cayman Islands” “Central African Republic” “Chad” “Chile” “China” “Christmas Island” “Cocos Islands” “Colombia” “Comoros” “Congo” “Congo, Democratic Republic of the” “Cook Islands” “Costa Rica” “Croatia” “Cuba” “Cura?ao” “Cyprus” “Czechia” “C?te d’Ivoire” “Denmark” “Djibouti” “Dominica” “Dominican Republic” “Ecuador” “Egypt” “El Salvador” “Equatorial Guinea” “Eritrea” “Estonia” “Eswatini” “Ethiopia” “Falkland Islands” “Faroe Islands” “Fiji” “Finland” “France” “French Guiana” “French Polynesia” “French Southern Territories” “Gabon” “Gambia” “Georgia” “Germany” “Ghana” “Gibraltar” “Greece” “Greenland” “Grenada” “Guadeloupe” “Guam” “Guatemala” “Guernsey” “Guinea” “Guinea-Bissau” “Guyana” “Haiti” “Heard Island and McDonald Islands” “Holy See” “Honduras” “Hong Kong” “Hungary” “Iceland” “India” “Indonesia” “Iran” “Iraq” “Ireland” “Isle of Man” “Israel” “Italy” “Jamaica” “Japan” “Jersey” “Jordan” “Kazakhstan” “Kenya” “Kiribati” “Korea, Democratic People’s Republic of” “Korea, Republic of” “Kuwait” “Kyrgyzstan” “Lao People’s Democratic Republic” “Latvia” “Lebanon” “Lesotho” “Liberia” “Libya” “Liechtenstein” “Lithuania” “Luxembourg” “Macao” “Madagascar” “Malawi” “Malaysia” “Maldives” “Mali” “Malta” “Marshall Islands” “Martinique” “Mauritania” “Mauritius” “Mayotte” “Mexico” “Micronesia” “Moldova” “Monaco” “Mongolia” “Montenegro” “Montserrat” “Morocco” “Mozambique” “Myanmar” “Namibia” “Nauru” “Nepal” “Netherlands” “New Caledonia” “New Zealand” “Nicaragua” “Niger” “Nigeria” “Niue” “Norfolk Island” “North Macedonia” “Northern Mariana Islands” “Norway” “Oman” “Pakistan” “Palau” “Palestine, State of” “Panama” “Papua New Guinea” “Paraguay” “Peru” “Philippines” “Pitcairn” “Poland” “Portugal” “Puerto Rico” “Qatar” “Romania” “Russian Federation” “Rwanda” “Réunion” “Saint Barthélemy” “Saint Helena, Ascension and Tristan da Cunha” “Saint Kitts and Nevis” “Saint Lucia” “Saint Martin” “Saint Pierre and Miquelon” “Saint Vincent and the Grenadines” “Samoa” “San Marino” “Sao Tome and Principe” “Saudi Arabia” “Senegal” “Serbia” “Seychelles” “Sierra Leone” “Singapore” “Sint Maarten” “Slovakia” “Slovenia” “Solomon Islands” “Somalia” “South Africa” “South Georgia and the South Sandwich Islands” “South Sudan” “Spain” “Sri Lanka” “Sudan” “Suriname” “Svalbard and Jan Mayen” “Sweden” “Switzerland” “Syria Arab Republic” “Taiwan” “Tajikistan” “Tanzania, the United Republic of” “Thailand” “Timor-Leste” “Togo” “Tokelau” “Tonga” “Trinidad and Tobago” “Tunisia” “Turkmenistan” “Turks and Caicos Islands” “Tuvalu” “Türkiye” “US Minor Outlying Islands” “Uganda” “Ukraine” “United Arab Emirates” “United Kingdom” “United States” “Uruguay” “Uzbekistan” “Vanuatu” “Venezuela” “Viet Nam” “Virgin Islands, British” “Virgin Islands, U.S.” “Wallis and Futuna” “Western Sahara” “Yemen” “Zambia” “Zimbabwe” “?land Islands”]

    This resulted in a console log error:

    wp-json/contact-form-7/v1/contact-forms/7175/feedback 500 (Internal Server Error)

    When inspecting the JSON returned:

            "error": {
                "type": 1,
                "message": "Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in wp-content\plugins\contact-form-7-to-database-extension\CF7DBPlugin.php:828
    				Stack trace:
    				#0 wp-content\plugins\contact-form-7-to-database-extension\CF7DBPlugin.php(828): implode(Array, ', ')
    				#1 wp-content\plugins\contact-form-7-to-database-extension\CFDBIntegrationContactForm7.php(55): CF7DBPlugin->saveFormData(Object(stdClass))
    				#2 wp-includes\class-wp-hook.php(326): CFDBIntegrationContactForm7->saveFormData(Object(WPCF7_ContactForm))
    				#3 wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
    				#4 wp-includes\plugin.php(565): WP_Hook->do_action(Array)
    				#5 wp-content\plugins\contact-form-7\includes\submission.php(710): do_action_ref_array('wpcf7_before_se...', Array)
    				#6 wp-content\plugins\contact-form-7\includes\submission.php(111): WPCF7_Submission->before_send_mail()
    				#7 [internal function]: WPCF7_Submission->{closure}()
    				#8 wp-content\plugins\contact-form-7\includes\l10n.php(147): call_user_func(Object(Closure))
    				#9 wp-content\plugins\contact-form-7\includes\submission.php(137): wpcf7_switch_locale('en_AU', Object(Closure))
    				#10 wp-content\plugins\contact-form-7\includes\submission.php(35): WPCF7_Submission->proceed()
    				#11 wp-content\plugins\contact-form-7\includes\contact-form.php(1062): WPCF7_Submission::get_instance(Object(WPCF7_ContactForm), Array)
    				#12 wp-content\plugins\contact-form-7\includes\rest-api.php(365): WPCF7_ContactForm->submit()
    				#13 wp-includes\rest-api\class-wp-rest-server.php(1230): WPCF7_REST_Controller->create_feedback(Object(WP_REST_Request))
    				#14 wp-includes\rest-api\class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '\/contact-form-7...', Array, NULL)
    				#15 wp-includes\rest-api\class-wp-rest-server.php(439): WP_REST_Server->dispatch(Object(WP_REST_Request))
    				#16 wp-includes\rest-api.php(428): WP_REST_Server->serve_request('\/contact-form-7...')
    				#17 wp-includes\class-wp-hook.php(324): rest_api_loaded(Object(WP))
    				#18 wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
    				#19 wp-includes\plugin.php(565): WP_Hook->do_action(Array)
    				#20 wp-includes\class-wp.php(418): do_action_ref_array('parse_request', Array)
    				#21 wp-includes\class-wp.php(813): WP->parse_request('')
    				#22 wp-includes\functions.php(1336): WP->main('')
    				#23 wp-blog-header.php(16): wp()
    				#24 index.php(17): require('C:\\Users\\Shanno...')
    				#25 {main}
    				  thrown",
                "file": "wp-content\plugins\contact-form-7-to-database-extension\CF7DBPlugin.php",
                "line": 828
            }
  • The topic ‘Error with large list of countries in select list’ is closed to new replies.