Problem/Motivation

The issue is that if a view is created with a contextual filter comparing the created or modified week of the node with the current date(which checks for the current week), the view does not return the expected result.

To reproduce the issue create a view with a contextual filter which checks the created or modified week of the nodes, and then select the current date from the provided options to check for the current week. Now the view have to return the nodes which are created in the current week. But the view does not return the correct nodes as expected. This is because views are checking for the weekday number(1-7) but actually have to check for the yearly week number between(1-53).

Proposed resolution

I have created a patch which will solve the issue. The view function checking for the date contextual filter is using the 'w' parameter for the date() function which will return the weekday number(1-7) but actually have to use the parameter 'W' which will return the yearly week number(1-53). The patch will replace the parameter for the date function from 'w' to 'W'.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

arjun_sreekumar’s picture

Issue summary: View changes
arjun_sreekumar’s picture

Issue summary: View changes
arjun_sreekumar’s picture

Attributing this contribution to Zyxware Technologies.

VM’s picture

Status: Active » Needs review

as there is a patch attach the above comment should have moved to "needs review".
Patch hasn't need tested and remained in queue.
Re-queued patch for testing.

renatog’s picture