Problem/Motivation
This is a follow-up to #3241299-20: Properly return FALSE for invalid strings in DateTimePlus::checkArray() so that the correct exception is thrown. Drupal\Component\Datetime\DateTimePlus::checkArray() is a static validation function used for checking that date parts are valid. It is only called by DateTimePlus::createFromArray(). @xjm suggested that ::checkArray() should be made protected in the next major version.
Proposed resolution
Make DateTimePlus::checkArray() a protected method.
Remaining tasks
User interface changes
Introduced terminology
API changes
DateTimePlus::checkArray() will be a protected method.
Data model changes
Release notes snippet
Issue fork drupal-3566186
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:
- 3566186-make-datetimepluscheckarray-protected
changes, plain diff MR !14255
Comments
Comment #2
dcam commentedThis seems like it's probably a good Novice issue.
Comment #3
priyansu18 commentedWorking on it.
Comment #5
adwivedi008 commentedHello priyansu18,
Reviewed the MR, and it seems fine to me
Moving the issue to needs review, let's get some more reviews, and then we can promote to RTBC
Comment #6
priyansu18 commentedHi @adwivedi008, after the fix it was creating problem in test files. So, I have fixed that too. Now it's ready to review.
Comment #7
smustgrave commentedDefinitely believe this could use a CR, not sure any BC concerns.
Comment #8
priyansu18 commentedThanks for the feedback. I don’t see any backward compatibility impact here since the changes are limited to fixes.
Comment #10
smustgrave commentedMR appears to need a rebase.
CR still needed.
Comment #11
alok_work23 commentedHii,
I am interested in contributing and would like to help with this issue.
@priyansu18 - Are you still working on this? If you need help with the rebase or change record, I would be happy to assist.
If you're no longer able to work on this, I could take it over and complete the remaining tasks.
Thanks!
Comment #12
priyansu18 commentedI'm little bit busy in a project, need some time to check it. In the meantime @alok_work23 if you really want to work on it, you can, but pls be careful.
Comment #13
priyansu18 commentedIf any issue comes up, please leave it as is, I’ll check it shortly.
Comment #15
avinash.jha commentedComment #16
smustgrave commentedappears to be a bad rebase. There's a lot of changes in the MR that probably shouldn't be there, sorry moving to NW.
Also#10 still applies
Thanks all
Comment #18
jan.fetalvero commentedRebased against current main and updated the issue fork. Change record has been drafted: https://www.drupal.org/node/3577926
Comment #19
jan.fetalvero commentedComment #20
dcam commentedThank you to all the new contributors who have worked on this issue! We appreciate your contributions to Drupal!
I have added a comment and code suggestion to the merge request and am setting the status to Needs Work for a change to be made. An unnecessary variable assignment was added to the merge request that needs to be removed.
I updated the change record and changed the examples. Before/after examples in change records aren't intended to show what was changed in Drupal. They're meant to help people who are coming to the record looking for answers about why their code is broken. They need information about what steps they should take to fix their code. So the before/after examples should reflect how to fix implementations.
Comment #22
dcam commentedThank you, @sujal_31. My feedback was addressed. These changes are pretty simple, so I don't think there's much else to say about them.
For the record, I didn't find any uses of the method in contrib. See https://search.tresbien.tech/search?q=DateTimePlus%3A%3AcheckArray.
Comment #24
catchCommitted/pushed to main, thanks!