Problem/Motivation

In #3029500: Drupal\Core\Database\Query\Select::hasAllTags() and hasAnyTag() will require a new "$tags" argument in the next major version of its parent class we are removing documented variable arguments from Drupal\Core\Database\Query\AlterableInterface::hasAllTags() and hasAnyTag() because it generates deprecation errors due to the missing implementation in mock classes in tests.

Proposed resolution

In Drupal 8.8 we'll drop PHP 5 support and could possibly restore this documentation as a variadic (http://php.net/manual/en/functions.arguments.php#functions.variable-arg-...). From @alexpott:

Add back the @param but this time make it a proper variadic because then we've dropped PHP5 and then we can add the argument to the implementations so Symfony 4 doesn't trigger the deprecation and then finally in Drupal 9 we can add the variadic argument to the interface.

Follow Interface and base/abstract class method signature changes from How to Deprecate.

Remaining tasks

Review
Commit

User interface changes

None.

API changes

None in Drupal 8.8, only the docs will return.

Data model changes

None.

Release notes snippet

N/A

Issue fork drupal-3029729

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:

Comments

Gábor Hojtsy created an issue. See original summary.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

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

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

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

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

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

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.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.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now 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.

quietone’s picture

Status: Postponed » Active
longwave’s picture

Component: base system » database system
Status: Active » Needs review
StatusFileSize
new1.28 KB

I think this is the right way to document this.

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

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now 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.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now 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.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new143 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

nikhil_110’s picture

StatusFileSize
new1.28 KB

Attached patch against Drupal 10.1.x

Patch #9 is not applied for Drupal 10.1.x so Inter-diff file is not added.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs work » Needs review

I just converted this to an MR.

quietone’s picture

Title: Restore documentation on variable arguments in Drupal\Core\Database\Query\AlterableInterface::hasAllTags() and hasAnyTag() in Drupal 8.8 » Restore documentation on variable arguments in Drupal\Core\Database\Query\AlterableInterface::hasAllTags() and hasAnyTag()
needs-review-queue-bot’s picture

Status: Needs review » Needs work

The Needs Review Queue Bot tested this issue.

While you are making the above changes, we recommend that you convert this patch to a merge request. Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

quietone’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems pretty straight forward.

nod_’s picture

Status: Reviewed & tested by the community » Needs work

This doesn't seem enough, we need a variable name. In PHP you need to do

function test(...$params) {}

for this to work, so doc needs to be @param string …$params, we can't have only the .

quietone’s picture

Status: Needs work » Needs review

@nod_, thanks. I converted that without much though, sorry.

quietone’s picture

Status: Needs review » Needs work
quietone’s picture

Issue summary: View changes
Status: Needs work » Needs review
Related issues: +#3501046: Replace func_get_args with variable-length argument in hasAllTags and hasAnyTag
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Believe feedback has been addressed on this one. Based on the D11 release know we search for drupal:12.0.0 so should be good there.

quietone’s picture

Status: Reviewed & tested by the community » Needs review

I checked in on this and noticed that the links in the @todo were incorrect. I updated them and rebased.

daffie’s picture

@quietone: It is for me RTBC with or without the nitpicks.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

believe feedback has been addressed on this one.

  • nod_ committed 80adfea4 on 11.x
    Issue #3029729 by quietone, longwave, smustgrave, gábor hojtsy, nod_:...
nod_’s picture

Status: Reviewed & tested by the community » Fixed

Committed 80adfea and pushed to 11.x. Thanks!

mondrake’s picture

Status: Fixed » Reviewed & tested by the community

Maybe there is a small misconception in the deprecation ignore file? See comment inline

  • longwave committed 8a856ce4 on 11.x
    Issue #3029729 followup by mondrake: Restore documentation on variable...

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Thank you @mondrake.

Status: Fixed » Closed (fixed)

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