Problem/Motivation
Since #1844956: Optimize date formatting performance this method does nothing, it just returns its argument as is.
And it is not used anywhere in core or in contrib (https://search.tresbien.tech/search?q=prepareFormat).
Steps to reproduce
Proposed resolution
Deprecate the function in 11.5.0 for removal in 12.0.0.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3617943
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
Comment #4
bt dev2 commentedI have removed the prepareFormat() method from core/lib/Drupal/Component/Datetime/DateTimePlus.php class file and created an MR.
Comment #5
nitinkumar_7 commentedThe pipeline is currently failing, but the available job output appears to show failures during artifact collection/upload rather than a PHPUnit test failure. Could we confirm whether these are infrastructure/CI artifact issues and rerun the pipeline before reviewing the MR further?
Comment #6
bt dev2 commentedPHPUnit test passed now, but I still see some warnings for PHP 8.6.
Comment #7
smustgrave commentedThink we should still be on the safe side and properly deprecate it just in case any custom code could be using it. Probably safe to deprecate in 11.5 and remove in 12.
Comment #8
bt dev2 commentedI added the method back and added a deprecated warning. Please review it.
For the pipeline, PHPTest is passing, but there is an issue with the PHPUnit Functional JavaScript test. I don't think that is relevent to this task.
Comment #9
dcam commentedThank you for working on this, @bt dev2. Deprecations require a change record (CR) to be written. Here's a similar CR for a function that was deprecated without replacement: https://www.drupal.org/node/3586362. There's a link to add a "change notice" near the top of this issue just above the "Related issues" heading.
After the CR is written, the URL in the deprecation messages must be changed to the CR's URL.
Yes, you're correct that the test failure has nothing to do with this issue. There is a list of known, intermittent test failures at #2829040: [meta] Known intermittent, random, and environment-specific test failures. In the future, you can check a failure against that list. If it's on there, then you probably don't need to worry about it. Not all intermittent failures are on that list, but the worst ones are.