As described in #2698337 I used the template generator to create the calendar views. The week view is currently broken for me. If opened I get a blank page. The error log reads:

mod_fcgid: stderr: PHP Fatal error: Class 'Drupal\\datetime\\Plugin\\views\\Argument\\Date' not found in /.../modules/calendar/src/Plugin/views/argument/DatetimeYearWeekDate.php on line 18

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pheraph created an issue. See original summary.

Anonymous’s picture

This class has been around a long time: #1838242: Provide Views integration for datetime field

I do however see that we don't have an explicit dependency to the DateTime module. Is it enabled? Did you do a full install?

pheraph’s picture

I installed via drush en calendar. Both modules (calendar, calendar_datetime) and the core module datetime are enabled. Strange.

la_gnf_1’s picture

I am getting this same error with the week view. Did you figure out what the problem/fix is? Thanks.

afeijo’s picture

I'm facing the same problem, and after analysing the calendar code, I figured out the problem

It is a simple case sensitive issue

change the line 11

use Drupal\datetime\Plugin\views\Argument\Date as DateTimeDate;

to

use Drupal\datetime\Plugin\views\argument\Date as DateTimeDate;

afeijo’s picture

Status: Active » Needs review
FileSize
620 bytes

providing the patch

la_gnf_1’s picture

afeijo, Your patch fixed the issue for me. Thanks.

pheraph’s picture

Yes, #6 fixed it for me, too. Thanks afeijo.

pheraph’s picture

Status: Needs review » Reviewed & tested by the community
Anonymous’s picture

Status: Reviewed & tested by the community » Fixed

PHP namespaces should be case-insensitive, however, from what I found it's possible that autoloading makes the namespaces case-sensitive anyway.

Since several people verified that the patch is needed even though I cannot reproduce it (might be due to OS or PHP version), I committed and pushed it to 8.x-1.x, along with the removal of some redundant newlines in that file. Thanks!

Please note that the Date class to which the use statement refers, has the capital in it's namespace even though all other classes around it don't have it.

namespace Drupal\datetime\Plugin\views\Argument;

If this proves to be an issue, a bug should be filed against core (datetime module).

  • pjonckiere committed 4dafb68 on 8.x-1.x authored by afeijo
    Issue #2698353 by afeijo, pheraph, la_gnf_1, pjonckiere: Week view...

Status: Fixed » Closed (fixed)

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