I have several modal windows created with Modal module on my site. None of them show up!
For example, if you go to the front page of my site (https://lejardindepoissy.org/), you should have one that appears.
If you inspect the HTML code of the page, you can find this:
<div id="js-modal-page-show-modal" class="modal fade js-modal-page-show" data-modal-options="{"id":"bourse_aux_paniers","auto_open":true,"prevent_default":0,"open_modal_on_element_click":""}" data-keyboard="true" data-backdrop="true" aria-modal="true" aria-labelledby="bourse_aux_paniers_label" aria-describedby="bourse_aux_paniers_desc" role="dialog" tabindex="-1">
<div class="modal-page-dialog modal-dialog modal-md" role="document">
<div class="modal-page-content modal-content">
<div class="modal-page-content modal-header modal-no-border">
<h4 id="bourse_aux_paniers_label" class="modal-title modal-page-title">
Bourse aux paniers
</h4>
<div class="modal-header-right">
</div>
</div>
<div id="bourse_aux_paniers_desc" class="modal-body modal-page-body">
Des paniers sont disponibles dans la Bourse aux paniers. <a class="button-round" href="/amap/reserveBasket">J'y vais !</a>
</div>
<div class="modal-footer modal-page-footer modal-no-border">
<label class="modal-dont-show-again-label">
<input type="checkbox" class="modal-page-please-do-not-show-again" value="bourse_aux_paniers">
Ne plus montrer ce message</label>
<input type="hidden" id="cookie_expiration" name="cookie_expiration" value="10000">
<div class="modal-buttons">
<button type="button" class="btn btn-default js-modal-page-ok-button " data-dismiss="modal">OK</button>
</div>
</div>
<input type="hidden" id="modal_id" name="modal_id" value="bourse_aux_paniers">
<input type="hidden" id="delay_display" name="delay_display" value="0">
<input type="hidden" id="show_once" name="show_once" value="">
<input type="hidden" id="auto_hide" name="auto_hide" value="">
<input type="hidden" id="auto_hide_delay" name="auto_hide_delay" value="5">
</div>
</div>
</div>
which means (I assume) the modal is well loaded in the page.
But it doesn't show up.
And I didn't find any error in the console.
The current version of Modal I use is 5.1.7 and since I updated to this version, I upgraded Drupal to version 11 (11.3.3 currently).
Any idea?
Comments
Comment #2
renatog commented@gbmapo just as a test, could you try clear your cookies, please?
Explanation
If it didn't fix, please let me know and we can try a different approach
Comment #3
gbmapo commentedThanks for the answer.
Unfortunately, it doesn't fix the problem.
I tried with two different browsers (Firefox and Safari) with the same result.
Comment #4
renatog commentedMaybe can be related to #3572172: Error on Modal 5.1 and D11 related to cookie
I saw your site
The Modal is really there
Is marked as "auto-open"
So should be displayed
The issue above is related to Modal 5.1 and D11
So can be related to this
I'm planning to merge that soon
Probably tomorrow
If you prefer, the patch is available at: https://git.drupalcode.org/project/modal_page/-/merge_requests/73.patch
Just to confirm, what was the version that was working? Modal 5.1 with D10? Or a different combination?
Comment #5
renatog commentedJust other questions
drush updbor applied the updates at/update.php?drush cr?Comment #6
gbmapo commentedI'm pretty sure it worked with Drupal 10.6.2 and Modal 5.1.7.
Yes, I ran drush updb and cache was rebuilt with drush cr.
Comment #7
gbmapo commentedI tried to use the patch you mentioned in #4 but I'm not very familiar with that kind of stuff...
I understand it updates code in /web/modules/contrib/modal_page folder.
But once executed, I got this:
What about the failed hunk?
And assuming everything goes well, what am I supposed to do next to take into account these updates?
Comment #8
renatog commentedJust released a new version with the compatibility fix between Modal 5.1 and Drupal 11
https://www.drupal.org/project/modal_page/releases/5.1.8
@gbmapo could you do this, please?
5.1.8/admin/modulesjs_cookiecomposer require 'drupal/js_cookie:^1.0'drush en js_cookie -ydrush crIf you followed these steps, are on Modal 5.1.8 with js_cookie installed and still not working, could you export the YML of Modal configs and share with me please?
P.S. The YML has only the configurations without sensible information. If you want you can clear the "Modal Body". The idea is just to help you and other users that may have the same issue in the future
Comment #9
gbmapo commentedI have updated Modal to 5.1.8.
No improvement 😢
I have another example of modal not working you might check as well.
In this page, the modal is triggered by the 'Aide' button.
I attached the corresponding config files:
- modal_page.modal.bourse_aux_paniers.yml (in the front page)
- modal_page.modal.help_list_of_contracts_for_anonymous.yml (in the Contrats page)
- modal_page.settings.yml
Comment #10
gbmapo commentedI forgot the files in my previous comment...
Comment #11
renatog commented@gbmapo seems that you need to set BS5 on D11
Steps
Explanation
Please let me know if worked
Comment #12
gbmapo commentedIt is weird!
With UI, it is Bootstarp 5 which is selected (see Screen Capture).
How is it possible to have
bootstrap_version: 3xinmodal_page.settings.yml?By the way, there is only one possible value in the drop down list. Is it normal?
Comment #13
renatog commentedCould you re-save this form please?
Yes, on D11 the option 3X was removed (because don't works with D11)
So the default value appears as 5X
However, maybe in the database still 3X
For this reason the YML settings appears as 3X
So I recommend you:
The step 3 will save that in the database
I think it should works
Let's try! If don't fix, please let me know
Comment #14
gbmapo commentedIt works!
Thanks a lot.
Comment #15
renatog commentedAwesome!
It's curious because the hook modal_page_update_500002 should have applied that automatically
Maybe when this hook has been applied the Drupal wasn't on 11 yet and for this reason didn't applye the update.
But it's okay, I'm happy that worked! And congrats on your website. It's super cool
Thank you so much @gbmapo