Problem/Motivation

When visiting the /events/month URI on the attached view I am getting:

Fatal error: Call to a member function getValue() on a non-object in /calendar/src/Plugin/views/row/Calendar.php on line 419

This comes from !empty($field->getValue()), where it should check the !empty($field)

Proposed resolution

As above, change to !empty($field) or perhaps:

if (!empty($field) && $date_str = $field->getValue()[0]['value']) {
// ...
          $item_start_date->setTimestamp($date_str);
// ...
        }

Remaining tasks

Review patch

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mccrodp created an issue. See original summary.

mccrodp’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
1.11 KB
tedbow’s picture

Status: Needs review » Active

@mccrodp thanks for the patch. But these line got changed in #2620898: Remove CalendarDate argument class for arguments in calendar_datetime. Please let me know if you still have the problem

The problem should be fixed. I also created \Drupal\calendar\DateFieldWrapper to take care of issues like this.

Calendar for Drupal 8 still has many problems.

tedbow’s picture

Status: Active » Fixed

This is fixed now

mccrodp’s picture

Status: Fixed » Closed (fixed)

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