Error when drag and drop content in calendar
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3010536. --> Reported by: [howto](https://www.drupal.org/user/993012) >>> <p>Hi,<br> I got error when drag and drop to change a date for content in calendar.</p> <p>What I did:</p> <ol> <li>Create new content type "Project". Setup it for calendar use.</li> <li>Open calendar, hover on "+" icon</li> <li>Create new project =&gt; it ok</li> <li>Then I drag and drop it to another day.</li> <li>An error "An error occured during the update of the desired node. Please consult the watchdog." displayed.</li> <li>In Chrome console I see that it request URL: "<a href="http://localhost/admin/content-calendar/update-node-publish-date/24/2018-10-30">http://localhost/admin/content-calendar/update-node-publish-date/24/2018-10-30</a>" that not found. I think it should be "<a href="http://localhost/">http://localhost/</a><strong>mylocalsite</strong>/admin/content-calendar/update-node-publish-date/24/2018-10-30"</li> <li>Then I changed the URL to <a href="http://localhost/">http://localhost/</a><strong>mylocalsite</strong>/admin/content-calendar/update-node-publish-date/24/2018-10-30 and run it.</li> <li>Then I got the response</li> </ol> <p>{<br> "success": true,<br> "message": "The creation date for Node 24 has been updated"<br> }<br> Then I reload the calendar, but the content disappear and this error displayed</p> <p>Notice: Undefined offset: 0 in Drupal\content_calendar\Controller\CalendarController-&gt;updateNodePublishDate() (line 151 of modules/contrib/content_planner/modules/content_calendar/src/Controller/CalendarController.php).<br> Drupal\content_calendar\Controller\CalendarController-&gt;updateNodePublishDate(Object, '2018-10-30')<br> call_user_func_array(Array, Array) (Line: 123)<br> Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)<br> Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)<br> Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)<br> Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)<br> Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)<br> Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)<br> Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)<br> Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)<br> Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)<br> Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)<br> Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 52)<br> Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)<br> Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 665)<br> Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)</p> <p>Can you tell me what I'm missing?</p> <p>Thanks,<br> Hao</p>
issue