Closed (fixed)
Project:
Date pager views plugin
Version:
2.1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jun 2020 at 16:14 UTC
Updated:
6 Jun 2025 at 13:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
sleitner commentedComment #5
kate heinlein commentedThanks (again!) @sleitner.
I merged it, but honestly with reviewing not entirely sure if it will work with all possible queries as sub queries.
So please come back in case there are any issues.
Comment #6
kate heinlein commentedSorry, I had to take back your changes.
The original view's queries did not join properly.
Comment #7
sleitner commentedDid you get an error message? Or any other clue how to reproduce this?
Comment #8
sleitner commentedStatic patch of MR2
Comment #9
j_s commentedI tried the patch and get this error:
Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'startDate' in field list is ambiguous
Comment #10
sleitner commented@j_s is one of your fields named startDate?
Comment #11
j_s commentedI think so
Comment #13
sleitner commented@j_s I renamed the temporary column, please try MR9
Comment #14
j_s commentedI couldn't get MR9 applied. It might be that it needs to be against 2.0.x instead of 8.x-1.x.
Comment #17
sleitner commented@j_s MR10 is now against 2.0.x
Comment #18
j_s commentedUsing MR10 I now get:
Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'startDatePager' in field list is ambiguous
Comment #19
sleitner commentedComment #20
vasyok commented#8 does not compatipbe with current 2.1.1-alpha2
I tried to patch it manually, but I received "The website encountered an unexpected error. "
There is an error in Drupal's log.
Message
Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'startDate' in field list is ambiguous: SELECT MIN(startDate) AS "min", MAX(endDate) AS "max" FROM "node__field_start" "node__field_start" INNER JOIN (SELECT "node_field_data"."langcode" AS "node_field_data_langcode", "node__field_start"."field_start_value" AS "node__field_start_field_start_value", "node_field_data"."nid" AS "nid", "node__field_start"."field_start_value" AS "startDate", "node__field_start"."field_start_value" AS "endDate" FROM "node_field_data" "node_field_data" LEFT JOIN "node__field_start" "node__field_start" ON node_field_data.nid = node__field_start.entity_id AND (node__field_start.deleted = :views_join_condition_0 AND node__field_start.langcode = node_field_data.langcode) INNER JOIN "taxonomy_index" "taxonomy_index" ON node_field_data.nid = taxonomy_index.nid WHERE ((taxonomy_index.tid = :taxonomy_index_tid)) AND (("node_field_data"."status" = :db_condition_placeholder_0) AND ("node_field_data"."langcode" IN (:db_condition_placeholder_1)) AND ((DATE_FORMAT((node__field_start.field_start_value + INTERVAL 3600 SECOND), '%Y-%m-%d\T%H:%i:%s') >= DATE_FORMAT(('2025-02-23T06:47:16' + INTERVAL 3600 SECOND), '%Y-%m-%d\T%H:%i:%s')))) ORDER BY "node__field_start_field_start_value" ASC) "node_field_datanidnode__field_startentity_idANDnode__field_startdeleted0ANDnode__field_startlangcodenode_field_datalangcode" INNER JOIN (SELECT "node_field_data"."langcode" AS "node_field_data_langcode", "node__field_start"."field_start_value" AS "node__field_start_field_start_value", "node_field_data"."nid" AS "nid", "node__field_start"."field_start_value" AS "startDate", "node__field_start"."field_start_value" AS "endDate" FROM "node_field_data" "node_field_data" LEFT JOIN "node__field_start" "node__field_start" ON node_field_data.nid = node__field_start.entity_id AND (node__field_start.deleted = :views_join_condition_0 AND node__field_start.langcode = node_field_data.langcode) INNER JOIN "taxonomy_index" "taxonomy_index" ON node_field_data.nid = taxonomy_index.nid WHERE ((taxonomy_index.tid = :taxonomy_index_tid)) AND (("node_field_data"."status" = :db_condition_placeholder_0) AND ("node_field_data"."langcode" IN (:db_condition_placeholder_1)) AND ((DATE_FORMAT((node__field_start.field_start_value + INTERVAL 3600 SECOND), '%Y-%m-%d\T%H:%i:%s') >= DATE_FORMAT(('2025-02-23T06:47:16' + INTERVAL 3600 SECOND), '%Y-%m-%d\T%H:%i:%s')))) ORDER BY "node__field_start_field_start_value" ASC) "node_field_datanidtaxonomy_indexnid"; Array ( [:taxonomy_index_tid] => 59 [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => en [:views_join_condition_0] => 0 ) in Drupal\mysql\Driver\Database\mysql\ExceptionHandler->handleExecutionException() (line 45 of /var/www/html/web/core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php).Backtrace
DeepSeec resolve this so I attach new patch.
Comment #21
sleitner commented@vasyok the tests are failing: https://git.drupalcode.org/project/date_pager/-/jobs/4477490 . Needs test coverage for filter usage.
Comment #22
sleitner commentedComment #23
vasyok commentedMaybe test failed, but its works :)
Comment #24
sleitner commentedYour code only worked if the date field was already a view filter or field. It fails, if another format is used.
Please test MR10
Comment #25
phjouJust tried this patch, it seem to work fine as long as the view has no cache enabled.
Comment #26
sleitner commentedComment #27
sleitner commentedDid you try the latest MR? The attached patches are outdated.
Comment #28
phjouYes I believe I tried the latest patch. Works fine when no cache is set on the view, but on tag based cache, my view was resetting the pager to only one page using this pager. My view is also set to use ajax.
Comment #29
sleitner commented@phjou , I could reproduce the issue
Comment #30
sleitner commentedThe date range was set too late, after the page filter was applied. Please review the MR
Comment #32
sleitner commented