Problem/Motivation

While creating a views argument handler for year+week, I discovered that the generated SQL was not correctly converting the PHP date() format 'oW' to the proper '%x%v' MySQL format.

Steps to reproduce

Proposed resolution

Add the 'o' => '%x', conversion to MysqlDateSql::$replace.

I will add a merge request shortly.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3218087

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gribnif created an issue. See original summary.

Lendude’s picture

Status: Active » Needs work
Issue tags: +Needs tests

'o' => '%x' seems right, but the PHP docs and MySQL docs are worded a little differently.

If we add this for MySQL we should also add it for SQLite and PostGres if they have something similar.

And we would need some tests added to MysqlDateSqlTest (and equivalent tests for the other supported drivers).

Version: 9.1.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nlisgo made their first commit to this issue’s fork.

nlisgo’s picture

Version: 9.5.x-dev » 11.x-dev
Status: Needs work » Needs review
Issue tags: -Needs tests
nlisgo’s picture

I've added a test and changed the target to 11.x we can backport afterwards. I've also adjusted the order that the new replace is introduced to the list so that the granularity order is maintained.

nlisgo’s picture

Issue tags: +Bug Smash Initiative
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

This seems like a simple fix and verified the test fails without the fix.

longwave’s picture

Version: 11.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed ef8f7aa87d to 11.x and 2c8a999b2d to 10.1.x. Thanks!

  • longwave committed 2c8a999b on 10.1.x
    Issue #3218087 by nlisgo, Gribnif, Lendude, smustgrave: Views...

  • longwave committed ef8f7aa8 on 11.x
    Issue #3218087 by nlisgo, Gribnif, Lendude, smustgrave: Views...

Status: Fixed » Closed (fixed)

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