Problem/Motivation

We have defaults for the Drupal core scope and identifier all over, example:

  public function getItem(string $scope = AccessPolicyInterface::SCOPE_DRUPAL, string|int $identifier = AccessPolicyInterface::SCOPE_DRUPAL): CalculatedPermissionsItemInterface|false;

But we do not in removeItem():

public function removeItem(string $scope, string|int $identifier): self;

Let's fix this, ideally before we ship 10.3

Steps to reproduce

try to use the API, see that you need to be verbose when calling removeItem();

Proposed resolution

Apply AccessPolicyInterface::SCOPE_DRUPAL defaults to removeItem()

Remaining tasks

Apply AccessPolicyInterface::SCOPE_DRUPAL defaults to removeItem()

User interface changes

/

API changes

AccessPolicyInterface::SCOPE_DRUPAL default on removeItem()

Data model changes

/

Release notes snippet

/

Issue fork drupal-3450890

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

kristiaanvandeneynde created an issue. See original summary.

kristiaanvandeneynde’s picture

Priority: Normal » Major

Setting to major for time sensitivity with D10.3-rc1 releasing next week.

kristiaanvandeneynde’s picture

Status: Active » Needs review

No clue why 11.0.x is failing on spellcheck

kristiaanvandeneynde changed the visibility of the branch 3450890-provide-sane-defaults to hidden.

smustgrave’s picture

So seems straight forward but the MR be pointed to 11.x vs 11.0.x

kristiaanvandeneynde’s picture

Done, we have one for 10.3.x, 11.0.x and 11.x now. No clue which one I should actually use by default to be honest.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

11.x I believe is still considered "main" so should land there first and then can be backported.

Thanks for making that change. tests are all green.

nod_’s picture

Title: Provide sane defaults for an Access Policy API method that was overlooked. » Provide defaults values for an Access Policy API method that was overlooked

Let's avoid using sane, it does not mean anything relevant here.

nicxvan’s picture

Title: Provide defaults values for an Access Policy API method that was overlooked » Provide default values for an Access Policy API method that was overlooked
Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

I updated the issue summary.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x, cherry-picked back through to 10.3.x, thanks!

  • catch committed 9fb79f28 on 10.3.x
    Issue #3450890 by kristiaanvandeneynde: Provide default values for an...

  • catch committed 35bfdeb2 on 10.4.x
    Issue #3450890 by kristiaanvandeneynde: Provide default values for an...

  • catch committed ee78369e on 11.0.x
    Issue #3450890 by kristiaanvandeneynde: Provide default values for an...

  • catch committed 75be7826 on 11.x
    Issue #3450890 by kristiaanvandeneynde: Provide default values for an...

Status: Fixed » Closed (fixed)

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