Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In the latest dev there is for each entity a notice that the $row doesn't contain the property named after $info['query_name']. That field is indeed not set and the field can only be retrieved from the entity.
Drupal version: 8.2.6.
$item_start_date = \DateTime::createFromFormat($storage_format, $row->{$info['query_name']});
$item_end_date = \DateTime::createFromFormat($storage_format, $row->{$info['query_name']});
Comment | File | Size | Author |
---|---|---|---|
#7 | calendar-row_undefined_property-2859127-7.patch | 1.26 KB | stomusic |
#3 | calendar-row_undefined_property-2859127-3.patch | 1.27 KB | _Archy_ |
Comments
Comment #2
_Archy_ CreditAttribution: _Archy_ at PitechPlus commentedWithout much knowledge of the module's code I am adding this simple fix. Don't know the implications, but seems to work for my case.
Comment #3
_Archy_ CreditAttribution: _Archy_ at PitechPlus commentedWrongly created patch.
Comment #4
mmbkI have had the same problem, and confirm that the patch is working.
It is located at the same codelines, where I just submitted a report
Comment #5
mmbkHmm, I justed wonder why the date field is fetched from the row instead of the entity.
The views-template is based on an entity's date field. So this field must exist in the entity, so I see no need for using the row. Furthermore the FieldDefinition() is queried from the entity, there it is already asumed that the field exists in the entity.
Edit:
OK, I found the reason why the row field has to be used, as soon as the field's cardinality is not 1, the entity-field will fetch the wrong values. As far as I see the actual delta is not accessible, so the row-value has to be used.
Comment #6
othermachines CreditAttribution: othermachines commentedSimilar approach proposed here: #2886868: Attempt to clean up the calendar row plugin
Comment #7
stomusicPatch update to actual module version.
Comment #8
stomusicComment #9
stomusicBetter solution here https://www.drupal.org/node/2699477
Comment #10
stomusichttps://www.drupal.org/node/2699477