liedekef / events-made-easy

The wordpress plugin events-made-easy to manage events, memberships and more.
https://www.e-dynamics.be/wordpress
GNU General Public License v2.0
24 stars 6 forks source link

List of holidays are not shown in calendar #640

Closed d0grafter closed 1 week ago

d0grafter commented 1 week ago

Describe the bug The List of holiday are not shown in the calendar.

ex.: 2024-05-01--2024-08-31, Sommerpause 2024-10-03, Feiertag 2024-12-20--2024-12-31, Weihnachtsferien

with

[eme_calendar full=1 htmltable=0 htmldiv=1 holiday_id=1]

I would expect the names of the holidays in the calendar

liedekef commented 1 week ago

This can't be reproduced: I copied over your holidays as-is and the calendar shortcode: the title shows perfectly. Maybe some CSS is hiding it on your end?

d0grafter commented 1 week ago

could you have a look into eme.js line https://github.com/liedekef/events-made-easy/blob/41d1e30c2783fa05c1a178376995baf93b87465f/js/eme.js#L78C3-L79C35 If I change the holiday_chosen to 1 in debugger everything is fine.

liedekef commented 1 week ago

holiday_chosen is passed as a data-param in eme-calendar.php, search for next_link there. So unless something is going on with how the data-params are interpreted, this should be ok. I just tried with extra alert-lines in eme.js, and the value is correctly taken. Maybe debug eme-calendar.php there? But here it works as intented ...

liedekef commented 1 week ago

btw: can you demo this?

d0grafter commented 1 week ago

I have it now hard coded....I could demo it, but I'm now in vacation for the next weeks

d0grafter commented 1 week ago

https://drive.proton.me/urls/MBE9HACT94#BFW64epGaMgX hi, two videos, which shows the behavior

liedekef commented 1 week ago

I see an auto-optimize JS in your video, did you install an caching/optimizer plugin? If so: which one? Also, check this small fix (that needed fixing anyway): https://github.com/liedekef/events-made-easy/commit/5d43d310744f4fa201b21923f6620e0db6877cb7

d0grafter commented 1 week ago

I checked everything without caching (autooptimize) and in inkognito mode with the fix implemented -> no change

liedekef commented 1 week ago

Can you show it on a live site? So I can check some html being generated?

d0grafter commented 1 week ago

https://www.gelebteliebe.de/veranstaltungen/ 03.10.24 should have the entry Feiertag

d0grafter commented 1 week ago

Please don't take to much time, for me it is enough, when I hardcode it

liedekef commented 1 week ago

As I suspected, the next-link has holiday_id=0: <a class="next-month eme-cal-next-month" href="#" data-full="1" data-htmltable="1" data-htmldiv="1" data-long_events="" data-month="10" data-year="2024" data-category="0" data-author="" data-contact_person="" data-location_id="" data-notcategory="0" data-template_id="0" data-holiday_id="0" data-weekdays="" data-language="de" data-calendar_divid="eme-calendar-122">&gt;&gt;</a> So something is wrong in the shortcode-calling itself. Can you verify the shortcode and arguments?

d0grafter commented 1 week ago

the shortcodes o the page are:

[eme_calendar full=1 htmltable=1 htmldiv=1 holiday_id=1]

[eme_events notcategory=6]

d0grafter commented 1 week ago

ah, I just saw, that the widget works with holidays on the sidebar

liedekef commented 1 week ago

If you want, you can add some debugging in eme-calendar.php, in the function eme_get_calendar_shortcode. You could add a line var_dump($atts); at the beginning of the function (just for 1 minute of course) and see if that already contains the correct info (should contain your shortcode arguments and values).

d0grafter commented 1 week ago

this is the result: array(4) { [0]=> string(25) "holiday_id=1" ["full"]=> string(1) "1" ["htmltable"]=> string(1) "1" ["htmldiv"]=> string(1) "1" }

looks fine

liedekef commented 1 week ago

that's like if holiday_id=1 is between quotes ... could you remove all that and add it manually? Or look in the text-version of the html editor to see if no other characters are present ...

d0grafter commented 1 week ago
           Hi  Frank, That was the reason; for some reason, there was <code>..... Now it works. Thank you so much for your help!
liedekef commented 1 week ago

If you copy/paste parts from the EME website into your html, then this can happen. Good to know it works (and it got me to fix a minor non-bug anyway :-) )