- Issue created by @sclsweb
- First commit to issue fork.
- Assigned to akshaydalvi212
- @akshaydalvi212 opened merge request.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 11:33am 25 April 2023 - 🇮🇳India akshaydalvi212
resolved the error and raised the MR.
kindly review. - Assigned to elber
- Issue was unassigned.
- Status changed to RTBC
over 1 year ago 4:02pm 25 April 2023 - 🇧🇷Brazil elber Brazil
Hi congratulations it is sounds good to me. Moving to RTBC.
- First commit to issue fork.
- 🇺🇸United States bburg Washington D.C.
Apologies, some other recent changes are conflicting with these updates.
- 🇺🇸United States bburg Washington D.C.
Does this actually work? I see the change:
- if (SmartDateTrait::isAllDay($startDatetime->getTimestamp(), $endDatetime->getTimestamp(), $dateTZ)) { + if ($this->isAllDay($startDatetime->getTimestamp(), $endDatetime->getTimestamp(), $dateTZ)) {\
We don't add the SmartDateTrait to the class, so I don't see how the method could work here. I admit, I haven't checked out the code and tested personally yet. I have some catching up to do on this module, which I am to do today.
- Status changed to Needs work
over 1 year ago 2:53pm 30 June 2023 - 🇺🇸United States bburg Washington D.C.
Yes, just tested, and I get the below error. So this needs some work.
The website encountered an unexpected error. Please try again later.<br /><em class="placeholder">Error</em>: Call to undefined method Drupal\views_ical\Plugin\views\row\IcalFieldsWizard::isAllDay() in <em class="placeholder">Drupal\views_ical\Plugin\views\row\IcalFieldsWizard->addSmartDateEvent()</em> (line <em class="placeholder">506</em> of <em class="placeholder">modules/contrib/views_ical/src/Plugin/views/row/IcalFieldsWizard.php</em>). <pre class="backtrace">Drupal\views_ical\Plugin\views\row\IcalFieldsWizard->addSmartDateEvent(Array, Object, Object, Array) (Line: 117) Drupal\views_ical\Plugin\views\row\IcalFieldsWizard->render(Object) (Line: 516) Drupal\views\Plugin\views\style\StylePluginBase->renderGroupingSets(Array) (Line: 476) Drupal\views\Plugin\views\style\StylePluginBase->render() (Line: 250) Drupal\views_ical\Plugin\views\style\IcalWizard->render(Array) (Line: 152) Drupal\views\Plugin\views\display\Feed->render() (Line: 77) Drupal\views_ical\Plugin\views\display\IcalDisplay->render() (Line: 1538) Drupal\views\ViewExecutable->render() (Line: 128) Drupal\views\Plugin\views\display\Feed->execute() (Line: 1635) Drupal\views\ViewExecutable->executeDisplay('ical_1', Array) (Line: 81) Drupal\views\Element\View::preRenderViewElement(Array) call_user_func_array(Array, Array) (Line: 101) Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788) Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374) Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 204) Drupal\Core\Render\Renderer->render(Array, 1) (Line: 148) Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 580) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 149) Drupal\Core\Render\Renderer->renderRoot(Array) (Line: 109) Drupal\views\Plugin\views\display\Feed::buildResponse('ical_test', 'ical_1', Array) (Line: 126) Drupal\views_ical\Plugin\views\display\IcalDisplay::buildResponse('ical_test', 'ical_1', Array) (Line: 56) Drupal\views\Routing\ViewPageController->handle('ical_test', 'ical_1', Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191) Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128) Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Status changed to Needs review
12 months ago 9:39pm 16 November 2023 - 🇺🇸United States sclsweb
This issue was causing WSOD errors and filling up my site logs, so I attempted... something, based on following examples from other modules. I'm not sure it is proper code or if it actually fixes the issue, unfortunately -- I'm using SmartDate with recurring rules, and either something is broken (but silently, with the patch) or my feed is set up wrong, not sure which (I download the .ics feed, it has items in it; I subscribe with Google Calendar, nothing there)
Could someone else test?
- 🇺🇸United States joshuasosa
MR!17 from #14 fixes the deprecated error message for me.
I'm able to add the calendar feed to my Outlook and Google Calendar using alpha12.
I'm not sure if this is a good place to put it, but I also see other warnings in logs:
Warning: Trying to access array offset on value of type null in Drupal\views_ical\ViewsIcalHelper->addTimezone() (line 435 of /drupal/web/modules/contrib/views_ical/src/ViewsIcalHelper.php)
Warning: Undefined array key -1 in Drupal\views_ical\ViewsIcalHelper->addTimezone() (line 434 of /drupal/web/modules/contrib/views_ical/src/ViewsIcalHelper.php)
- 🇺🇸United States bburg Washington D.C.
I'm not seeing the warnings myself, even with error reporting turned the way up, but that may just be the configuration in the ddev environment I am using.
Patch doesn't seem to cause issues. so going ahead and merging it. We can keep the issue open to look at the errors joshuasosa highlights.
I assume the error is being generated from this line:
$transitionPrev = $transitions[$transition['index'] - 1];
Where we are attempting to handle timezones for potential daylight savings. Based on the error, it sounds like the $transitions variable is null. I assume this is for a timezone that doesn't utilize daylight savings? We can do add some type checking here and just return.
- Status changed to Fixed
11 months ago 5:02pm 13 December 2023 - Status changed to Needs work
11 months ago 5:05pm 13 December 2023 - 🇺🇸United States bburg Washington D.C.
With an update like this:
if ($transitionPrev !== null) {
around that block in ViewsIcalHelper, I get this sample output:
BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Drupal iCal API//EN X-WR-TIMEZONE:UTC BEGIN:VTIMEZONE TZID:UTC X-LIC-LOCATION:UTC BEGIN:STANDARD TZNAME:UTC TZOFFSETFROM:+0000 TZOFFSETTO:+0000 DTSTART:20221024T201320 END:STANDARD BEGIN:STANDARD TZNAME:UTC TZOFFSETFROM:+0000 TZOFFSETTO:+0000 DTSTART:20221026T081319 END:STANDARD END:VTIMEZONE BEGIN:VEVENT UID:Christmas DTSTART;TZID=UTC:20231225T000000 SEQUENCE:0 TRANSP:TRANSPARENT DTEND;TZID=UTC:20231226T115959 SUMMARY: Christmas CLASS:PUBLIC DESCRIPTION: Christmas DTSTAMP:20231213T172851Z END:VEVENT END:VCALENDAR
For good measure, I set the site default timezone and my user's timezone preference to UTC. Does that seem like a valid output to you?
- 🇺🇸United States joshuasosa
Yes! It's for AZ time which uses MST without any daylight savings change. Putting in the suggested null check on $transitionPrev seems to clear up those warnings for me. Thanks!
- 🇺🇸United States joshuasosa
It looks like adding
if ($transition['index'] > 0) {
before $transitionPrev on 434 and closing after the !in_array if-block clears up these warnings for me.