WordPress.org

Make WordPress Core

Opened 10 months ago

Last modified 9 months ago

#51439 new defect (bug)

Docs: Undocumented @global instances

Reported by: ravipatel Owned by:
Milestone: Awaiting Review Priority: low
Severity: normal Version: 4.2
Component: General Keywords: has-patch needs-refresh close
Focuses: docs, coding-standards Cc:

Description

@global wpdb not define on line no 230.

display_setup_form() on define but not call outside of the function.

Attachments (5)

51439-install.php.patch (720 bytes) - added by ravipatel 10 months ago.
codeing standard undefine varible.
51439-install.php.2.patch (759 bytes) - added by ravipatel 10 months ago.
Added with full path for undefined varibale
51439-ajax-actions.php.patch (783 bytes) - added by ravipatel 10 months ago.
Added file patch another file - undefined variable
51439.patch (5.3 KB) - added by ravipatel 10 months ago.
Combile all chnages + $post_id missing to define on comment file.
51439-edit-form-comment.php.patch (739 bytes) - added by ravipatel 10 months ago.
$comment & $action not defined edit-form-comment.php

Download all attachments as: .zip

Change History (11)

@ravipatel
10 months ago

codeing standard undefine varible.

#1 @ravipatel
10 months ago

  • Version set to trunk

#2 @davidbaumwald
10 months ago

  • Keywords needs-refresh added
  • Priority changed from normal to low

@ravipatel Can you refresh these patches against the src? The patch does not include the file path and is more difficult to apply. For instance, install.php should be src/wp-admin/install.php.

Here's a Handbook page about creating the patch from src/ https://make.wordpress.org/core/handbook/tutorials/trac/submitting-a-patch/

Last edited 10 months ago by davidbaumwald (previous) (diff)

@ravipatel
10 months ago

Added with full path for undefined varibale

This ticket was mentioned in Slack in #core by ravi. View the logs.


10 months ago

@ravipatel
10 months ago

Added file patch another file - undefined variable

@ravipatel
10 months ago

Combile all chnages + $post_id missing to define on comment file.

@ravipatel
10 months ago

$comment & $action not defined edit-form-comment.php

#4 @davidbaumwald
10 months ago

  • Focuses docs added
  • Keywords close added
  • Summary changed from Undefined Varible - Codeing Standard to Docs: Undocumented @global instances

@ravipatel Looking at these patches more in depth, it looks like most of these added global vars are not necessary, as they are already defined earlier in execution. For example, this patch is not necessary. edit-form-comment.php is an included template, and both $action and $comment are defined in the parent file src/wp-admin/comment.php. Same goes for the $typenow and $wpdb in src/wp-admin/edit.php.

I'm adding the close keyword because I think this ticket is not needed. I'll leave it open for a couple of days to see if anyone think s this does deserve to be a standalone ticket. Please ensure that these variables are indeed undefined at runtime, if they aren't I suggest adding to this ticket instead.

#5 @ravipatel
10 months ago

@davidbaumwald
OK, but applied some changes which is right for a declaration for variables as per PHP code doc format.

#6 @hellofromTonya
9 months ago

  • Version changed from trunk to 4.2

The changes in the install.php file are from Version 4.2 rather than 5.6 (trunk), ie per Ticket #30799. Changing the Version to 4.2.

Note: See TracTickets for help on using tickets.