[Résolu] Modal display of post form parent selection not working
Ce fil est résolu. Voici une description du problème et la solution proposée.
Problem:
isplay a post form to create a post, in a Bootstrap modal,
the dropdown select was limited to 10 entries and the search facility does not function in Firefox browser.
jQuery(document).on( 'cred_form_ready', function($) {
// ALL YOUR CRED form JS code goes here. Add your JS code here
jQuery.fn.modal.Constructor.prototype.enforceFocus = function() {}
});
Relevant Documentation:
This support ticket is created Il y a 3 années et 5 mois. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
I am trying to: Display a post form to create a post, in a modal
Link to a page where the issue can be seen:
I expected to see: a dropdown select for a parent post that let me select to appropriate post
Instead, I got: the dropdown select was limited to 10 entries and the search facility does not function
I have a post form that creates an organisation-venue. Within that form there is a field to enable selection of a parent Place. There are lots of places to select from but the selection choice is restricted to 10 places (I think the latest 10 set up).
If I use the form on a page, it works fine.
However, if I put the form in a modal, the dropdown only allows a choice from the 10 places.
I have tried the same HTML codes you mentioned above:
With select2 feature enabled, the parent selector works fine, I can search parent post, see screenshot select2.JPG
So the problem you mentioned above is abnormal, please check these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here: https://toolset.com/account/downloads/
2) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again
4) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL and form URL, I need to test and debug it in my localhost, thanks https://toolset.com/faq/provide-supporters-copy-site/
I have another website where form modals are working fine. I compared the two sites and the one that is working uses old Toolset plugins (CRED 2.3.6 etc) and the failing site has all of the up to date ones. I did steps 1 and 2 above.
I have uploaded what I see. It looks like the code is not completing because the "not set" is at the bottom and I cannot move the curser into the enter box to search.
I will do some more investigation when I get chance.
I have run some tests and discovered that the problem only exists when the modal cannot be displayed without scrolling.
I set up a test form with only a title and the parent select field and it worked. I then added fields one by one until the form stopped working (coincided with modal size growing so you could not see it all atonce on the screen).
I removed a field and the form worked.
I added a field and the form stopped working.
Maybe you could rerun your test and add fields until the modal needed to be scrolled to see if it was failing in your set-up?
I have done as suggested. The error_log file is recording the following:
[23-Dec-2019 12:24:38 UTC] PHP Notice: ob_end_flush(): failed to send buffer of zlib output compression (0) in /home/milfordassociate/teesdalelocal.co.uk/wp-includes/functions.php on line 4552
[23-Dec-2019 12:24:40 UTC] PHP Warning: ob_start(): output handler 'ob_gzhandler' conflicts with 'zlib output compression' in /home/milfordassociate/teesdalelocal.co.uk/wp-content/themes/toolset-starter/css/theme-customizer-css.php on line 301
[23-Dec-2019 12:24:40 UTC] PHP Notice: ob_start(): failed to create buffer in /home/milfordassociate/teesdalelocal.co.uk/wp-content/themes/toolset-starter/css/theme-customizer-css.php on line 301
I had a look at the functions.php file and the code around line 4552 is as follows:
/**
* Flush all output buffers for PHP 5.2.
*
* Make sure all output buffers are flushed before our singletons are destroyed.
*
* @since 2.2.0
*/
function wp_ob_end_flush_all() {
$levels = ob_get_level();
for ( $i = 0; $i < $levels; $i++ ) {
ob_end_flush();
}
}
I have tried Firefox browser in my localhost, it works fine, see screenshot.
Please try these:
1) Clear your firefox browser cache and test again
2) If the problem still persists, please provide a copy of your website in below private message box, also point out the problem page URL and form URL, I need to test and debug it in my localhost, thanks
I just want to make sure that we are looking at the same thing.
When you click toselect a parent, where there are more choices than can be displayed in the dropdown, you should be able to type in the select field so a search is done for "hits" and those hits are then displayed in the dropdown.
The problem is that you cannot enter anything in the select box.