Hello,

I'm not sure if this is a bug, but when trying to build a calendar with nodes having the exact same created date and time (including seconds) the calendar is displaying only one result. There's no problem to have them all listed in a table or other format.

The view is very simple, no relationship, no aggregation, only a date field (the date when the node was created).

Does anyone have this problem or is just me?

Thank you!

Comments

gge created an issue. See original summary.

shailja179’s picture

Status: Active » Needs work
angelgarciaco’s picture

Hey George

I was reviewing and that's right. Only shows us one item if many of them have the same time (hours, minutes, seconds) I've incrememted 1 sec and then the content is shown in the calendar.

So, you aren't the one.

matthieuscarset’s picture

Status: Needs work » Needs review

Thank you for reporting this issue.

It's fixed in the commit above.

Could you please test the dev branch and let me know if the situation is okay for your calendar(s)?

omkar_yewale’s picture

Assigned: Unassigned » omkar_yewale
omkar_yewale’s picture

Assigned: omkar_yewale » Unassigned
StatusFileSize
new108.47 KB
new106.9 KB
new134.75 KB

Hi @matthieuscarset,

I have verified the module 2.1.x-dev version on both Drupal 9 and Drupal 10. In the Drupal 9 version, everything functions correctly, including the exact same date and time (including seconds) nodes. However, I encountered an issue with the Drupal 10 version. When I add more than two nodes with the same date, the view does not display anything and only shows a blank page. there are no error logs recorded in the recent log either.

robotjox’s picture

I can confirm this problem.
The dev version breaks the calendar for us (we get a white page with half a calendar and no styling), but I dont know if that is a problem on our side.

robotjox’s picture

Error with dev applied:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO "cache_discovery" ("cid", "expire", "created", "tags", "checksum", "data", "serialized") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6) ON DUPLICATE KEY UPDATE "cid" = VALUES("cid"), "expire" = VALUES("expire"), "created" = VALUES("created"), "tags" = VALUES("tags"), "checksum" = VALUES("checksum"), "data" = VALUES("data"), "serialized" = VALUES("serialized"); Array ( [:db_insert_placeholder_0] => views:exposed_form [:db_insert_placeholder_1] => -1 [:db_insert_placeholder_2] => 1684320047.775 [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => a:4:{s:3:"bef";a:9:{s:6:"parent";s:6:"parent";s:11:"plugin_type";s:12:"exposed_form";s:14:"register_theme";b:1;s:5:"title";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"*string";s:22:"Better Exposed Filters";s:12:"*arguments";a:0:{}s:10:"*options";a:0:{}}s:11:"short_title";s:0:"";s:4:"help";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"*string";s:54:"Provides additional options for exposed form elements.";s:12:"*arguments";a:0:{}s:10:"*options";a:0:{}}s:2:"id";s:3:"bef";s:5:"class";s:76:"Drupal\better_exposed_filters\Plugin\views\exposed_form\BetterExposedFilters";s:8:"provider";s:22:"better_exposed_filters";}s:10:"vefl_basic";a:9:{s:6:"parent";s:6:"parent";s:11:"plugin_type";s:12:"exposed_form";s:14:"register_theme";b:1;s:5:"title";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"*string";s:19:"Basic (with layout)";s:12:"*arguments";a:0:{}s:10:"*options";a:0:{}}s:11:"short_title";s:0:"";s:4:"help";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"*string";s:37:"Adds layout settings for Exposed form";s:12:"*arguments";a:0:{}s:10:"*options";a:0:{}}s:2:"id";s:10:"vefl_basic";s:5:"class";s:47:"Drupal\vefl\Plugin\views\exposed_form\VeflBasic";s:8:"provider";s:4:"vefl";}s:14:"input_required";a:9:{s:6:"parent";s:6:"parent";s:11:"plugin_type";s:12:"exposed_form";s:14:"register_theme";b:1;s:5:"title";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"*string";s:14:"Input required";s:12:"*arguments";a:0:{}s:10:"*options";a:0:{}}s:11:"short_title";s:0:"";s:4:"help";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"*string";s:73:"An exposed form that only renders a view if the form contains user input.";s:12:"*arguments";a:0:{}s:10:"*options";a:0:{}}s:2:"id";s:14:"input_required";s:5:"class";s:52:"Drupal\views\Plugin\views\exposed_form\InputRequired";s:8:"provider";s:5:"views";}s:5:"basic";a:9:{s:6:"parent";s:6:"parent";s:11:"plugin_type";s:12:"exposed_form";s:14:"register_theme";b:1;s:5:"title";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"*string";s:5:"Basic";s:12:"*arguments";a:0:{}s:10:"*options";a:0:{}}s:11:"short_title";s:0:"";s:4:"help";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:"*string";s:18:"Basic exposed form";s:12:"*arguments";a:0:{}s:10:"*options";a:0:{}}s:2:"id";s:5:"basic";s:5:"class";s:44:"Drupal\views\Plugin\views\exposed_form\Basic";s:8:"provider";s:5:"views";}} [:db_insert_placeholder_6] => 1 ) i Drupal\Core\Cache\DatabaseBackend->doSetMultiple() (linje 273 af /var/www/clients/client2/web15/web/web/core/lib/Drupal/Core/Cache/DatabaseBackend.php).

gge’s picture

Hello,

Applied the patch manually against version 2.1.1 and got this:
Got error 'PHP message: PHP Fatal error: Nesting level too deep - recursive dependency? in /var/www/public_html/web/modules/contrib/calendar_view/calendar_view.module on line 137'

Line 137 is:
array_multisort($array, SORT_ASC, $list);

The server is running php 8.1.18 (memory limit 2304M) and drupal 9.5.3.

Thanks~

robotjox’s picture

thanks @gge - commenting out that line makes everything work.
Events still seem to be sorted correctly.

omkar_yewale’s picture

I fixed it by using usort.

  if (count($list) > 1) {
    $array = array_map(function ($row) {
      return $row['#values']['first_instance'] ?? NULL;
    }, $list);
    array_multisort($array, SORT_ASC, $list);
  }

To

  if (count($list) > 1) {
    usort($list, function ($row1, $row2) {
      $instance1 = $row1['#values']['first_instance'] ?? NULL;
      $instance2 = $row2['#values']['first_instance'] ?? NULL;
      return $instance1 <=> $instance2;
    });
  }
gge’s picture

@robotjox you're welcome but not sure if the right solution is to comment out that line. As @matthieuscarset mentioned here, "Sort order is always ASC inside calendar days (e.g. in order to keep multiday events always at the top)"

robotjox’s picture

@gge totally agree, but without the patch a lot of events are not shown and with the patch site crashes, so until there is a proper solution, this hack works for us (we dont use many multiday events).

gge’s picture

@omkar_yewale your fix does the trick, thanks~

  • matthieuscarset committed 3331f2be on 2.1.x
    Issue #3360483 by omkar_yewale: When two nodes have the exact same date...
matthieuscarset’s picture

Status: Needs review » Fixed

Thank you very much for your reviews and for the fix.

The issue is fixed on the dev branch (see referenced commit above).

Tested with multiple days and multiple fields overlapping on the same calendar day.

Feel free to reopen if you find a new situation.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

angelgarciaco’s picture

Thanks dude.

svendecabooter’s picture

@matthieuscarset:
Any chance of tagging a new release soon, that includes this fix?

matthieuscarset’s picture

Oh, thank you for the heads up!

I've tagged a new release 2.1.2.