[wp-trac] [WordPress Trac] #57325: Fix the error 'Undefined array key' in 'wp-includes\class-requests.php' on line 214

WordPress Trac noreply at wordpress.org
Fri Dec 16 00:15:56 UTC 2022


#57325: Fix the error 'Undefined array key' in 'wp-includes\class-requests.php' on
line 214
--------------------------+------------------------
 Reporter:  ilyachalov    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  General       |     Version:
 Severity:  normal        |  Resolution:  duplicate
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:3 ilyachalov]:
 > My secondary goal when writing this ticket was to learn how to create a
 patch file from the 'Git' program (from the command line), such that it
 would be suitable for the 'SVN' version control system.

 That's a great goal!

 > Could you tell me if my patch file for the 'SVN' version control system
 is suitable for the 'WordPress' project? The documentation says the
 opposite things about this: the article
 [https://make.wordpress.org/core/handbook/contribute/git/ The Code
 Repository (Git)] section
 [https://make.wordpress.org/core/handbook/contribute/git/#patches Patches]
 says that you can use the {{{git diff}}} command; and the article
 [https://make.wordpress.org/core/handbook/tutorials/trac/submitting-a-patch/
 Submitting a Patch] section
 [https://make.wordpress.org/core/handbook/tutorials/trac/submitting-a-patch
 /#mac-linux-command-line Mac/Linux Command Line] there is a link to the
 article [http://scribu.net/wordpress/svn-patches-from-git.html svn patches
 from git] which recommends using the command {{{git diff --no-prefix}}}.

 `git diff` generates a file header with `a/` and `b/` prefixes:
 {{{
 diff --git a/src/readme.html b/src/readme.html
 index 72bc2afe4b..30bf19acaa 100644
 --- a/src/readme.html
 +++ b/src/readme.html
 }}}
 `git diff --no-prefix` omits them:
 {{{
 diff --git src/readme.html src/readme.html
 index 72bc2afe4b..30bf19acaa 100644
 --- src/readme.html
 +++ src/readme.html
 }}}

 I tried applying a patch with and without these prefixes using Subversion
 1.14.2, and both were applied successfully, so this does not seem to make
 any difference in practice, and `git diff` appears to work as expected.

 The "svn patches from git" article was written more than 10 years ago, so
 I suppose `git diff --no-prefix` was recommended at the time because of
 some compatibility issues that might not be relevant now.

 Technically, [attachment:"57325.diff"] is a perfectly valid patch that
 could have been accepted if it was not for an external library.

 It is also possible to contribute code changes to WordPress core using
 [https://make.wordpress.org/core/handbook/contribute/git/github-pull-
 requests-for-code-review/ GitHub Pull Requests]. That makes it easier to
 review larger patches, as well as to see the results of automated tests
 right away. If your PR description includes a Trac ticket URL, it will be
 automatically  linked to that ticket.

 If you're interested in further contributing to core, the
 [https://make.wordpress.org/core/handbook/tutorials/faq-for-new-
 contributors/ FAQ for New Contributors] article might be helpful. I would
 also like to invite you to **new core contributor meetings** every 2nd and
 4th Wednesday of the month at 19:00 UTC (an hour before weekly dev chat)
 in the #core channel on [https://make.wordpress.org/chat/ WordPress
 Slack], where you can ask any questions on contributing, working with
 patches, ask for a ticket review, next steps, etc. Welcome, and happy
 contributing! :)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57325#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list