Fixing #2610934: Call to undefined function Drupal\calendar\Plugin\views\style\l() creates urls like http://d8.local/calendar-created/week/2015-W45, however this page currently throws an error.

NOTICE: PHP message: Uncaught PHP Exception Drupal\Core\Database\DatabaseExceptionWrapper: "Exception in Calendar[calendar]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node_field_data.created_calendar' in 'where clause': SELECT node_field_data.created AS node_field_data_created, node_field_data.nid AS nid"

CommentFileSizeAuthor
#3 2610942-3.patch586 bytesgeertvd
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

geertvd created an issue. See original summary.

geertvd’s picture

Issue summary: View changes
geertvd’s picture

Status: Active » Needs work
FileSize
586 bytes

This fixes the fatal already, however nothing is displayed yet since the query looks like this now:

SELECT node_field_data.created AS node_field_data_created, node_field_data.nid AS nid
FROM 
{node_field_data} node_field_data
WHERE (( (DATE_FORMAT((DATE_ADD('19700101', INTERVAL node_field_data.created SECOND) + INTERVAL 3600 SECOND), '%Y-%m-%d') = '2015-W45') )AND(( (node_field_data.status = '1') )))
ORDER BY node_field_data_created ASC
Anonymous’s picture

Hmm. The format is the one the created field uses, whereas we want it to be '%Y-W%U' here. This will need some investigation.

tedbow’s picture

Hmmm. When applied the patch from #3 I get this error.

Fatal error: Class 'Drupal\calendar\Plugin\views\style\date_sql_handler' not found in .../calendar/src/Plugin/views/style/Calendar.php on line 457

I was assuming it because the #3 fixes a problem but it gets further and hits another one. That wouldn't explain why @pjonckiere and I are getting separate problems.

I made separate issue before I realized I had this patch applied. #2614360: Fatal error class not date_sql_handler

I will leave issue because it is a separate problem.

geertvd’s picture

fyi, the wrong query appears when we put these lines in comment:

if (!empty($argument)) {
  // @todo implement
  module_load_include('inc', 'date_api', 'date_api_sql');

  $date_handler = new date_sql_handler();
  $view_granularity = $date_handler->arg_granularity($argument);
}

We where looking into this briefly but forgot to mention that in this issue.

  • tedbow committed a460a3c on 8.x-1.x authored by geertvd
    Issue #2610942 by geertvd: Fatal error thrown when adding a filter value...
tedbow’s picture

Status: Needs work » Fixed

I am committed #3 because it fixes the fatal error. I think we will need another issue for arguments.

Status: Fixed » Closed (fixed)

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