Skip to content

Add correctly named getCustomerRegisterUrl() and deprecate the typo (#36735) - #41168

Open
lbajsarowicz wants to merge 7 commits into
magento:2.4-developfrom
lbajsarowicz:fix/36735-customer-register-url-typo
Open

Add correctly named getCustomerRegisterUrl() and deprecate the typo (#36735)#41168
lbajsarowicz wants to merge 7 commits into
magento:2.4-developfrom
lbajsarowicz:fix/36735-customer-register-url-typo

Conversation

@lbajsarowicz

Copy link
Copy Markdown
Contributor

Description

Magento\Customer\Block\Account\AuthenticationPopup::getCustomerRegisterUrlUrl() has a doubled "Url" in its name. It is still there on 2.4-develop (AuthenticationPopup.php:126).

The method is public on an @api block, so it cannot simply be renamed. This adds a correctly named getCustomerRegisterUrl(), has the old method delegate to it, and marks the old one @deprecated with a @see pointing at the replacement.

This PR continues #36794 by @Vasudev-22 (Partner: EY), rebased onto current 2.4-develop. Their commits and authorship are preserved.

The one review point that was never resolved

@Den4ik and @hostep both reviewed the original PR and every point was addressed except this one, from @hostep:

I think this one should be public instead of private, because the original method was also public? [...] won't we cause confusion with callers of the original method when we mark that one as deprecated and give no new method as alternative to call?

I agree, and this PR makes the replacement public. Deprecating a public method while offering only a private replacement leaves external callers with nowhere to migrate, which defeats the purpose of the deprecation. Adding a public method is additive; it is renaming or removing one that breaks backward compatibility.

Fixed Issues

Fixes #36735

Manual testing scenarios

  1. Open any storefront page with the authentication popup enabled.
  2. Confirm the "Create an Account" link in the popup still resolves to customer/account/create.
  3. Call both getCustomerRegisterUrl() and the deprecated getCustomerRegisterUrlUrl() on the block and confirm they return the same URL.

Questions or comments

Note for the Semantic Version Checker build: this adds a public method to a class annotated @api @since 100.0.2. That is an additive (minor) change rather than a breaking one, but it will show up in the SVC report, so flagging it explicitly rather than letting it surprise a reviewer. No existing signature is changed and the deprecated method is retained.

Gates run locally on 2.4-develop (Warden, PHP 8.3):

  • Unit: Customer/Test/Unit/Block/Account/ — 33 tests pass, including a new case asserting the deprecated method and its replacement return the same URL.
  • PHPCS Magento2: clean. PHPStan level 1: no errors.
  • Negative check on the new test: red against the unpatched block, green with the fix.

git grep across the repository finds no remaining caller of the old name outside its own declaration; the block's getConfig() was already updated to the new name in @Vasudev-22's original commits.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Vasudev-22 and others added 7 commits August 30, 2026 13:10
hostep pointed out that the new replacement method should be public since
the deprecated method it replaces was public, otherwise external callers
of the deprecated method have no BC-safe alternative to move to. Flip
visibility; adding a public method is additive and does not break BC.
@lbajsarowicz

Copy link
Copy Markdown
Contributor Author

@magento run all tests

@m2-assistant

m2-assistant Bot commented Aug 30, 2026

Copy link
Copy Markdown

Hi @lbajsarowicz. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@lbajsarowicz

Copy link
Copy Markdown
Contributor Author

@magento run Static Tests

@hostep

hostep commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

LGTM, @lbajsarowicz: static tests failure is probably on that copyright header: * Copyright 2015 Adobe. where the . at the end should be removed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: P3 May be fixed according to the position in the backlog. Progress: pending review

Projects

Status: Pending Review

Development

Successfully merging this pull request may close these issues.

Wrong name conversion on getCustomerRegisterUrlUrl() at AuthenticationPopup.php

4 participants