Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing variable reference in meta-box-partial-page.php #3092

Merged
merged 2 commits into from
Oct 21, 2017

Conversation

BE-Webdesign
Copy link
Contributor

Fix minor PHP error. See
#2804 (comment)

@BE-Webdesign BE-Webdesign requested a review from aduth October 20, 2017 17:39
@BE-Webdesign BE-Webdesign mentioned this pull request Oct 20, 2017
3 tasks
@@ -69,9 +69,12 @@ function gutenberg_meta_box_partial_page( $post_type, $meta_box_context ) {

global $post, $wp_meta_boxes, $hook_suffix, $current_screen, $wp_locale;

// This page should always match up with the edit action.
$action = 'edit';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If $action is always 'edit' and gutenberg_meta_box_partial_page_post_form is only ever called from here, is the 'edit' === $action even necessary? Are we expecting gutenberg_meta_box_partial_page_post_form to be called in other contexts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we expecting gutenberg_meta_box_partial_page_post_form to be called in other contexts?

I do not know. We can most likely get rid of this code then? I am fairly positive that metaboxes only ever display if the edit action is set on post.php, but that could be wrong. In this code I am setting it to be edit anyways, so it is probably best to just eliminate any of the code using action.

Copy link
Contributor Author

@BE-Webdesign BE-Webdesign Oct 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you want to merge as is, or remove any reference to action since it should always be edit anyways.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you want to merge as is, or remove any reference to action since it should always be edit anyways.

I'm content with either, but if we don't anticipate to need to check $action, probably best to remove.

The $action variable is not relavent in this context of meta boxes, as
the $action should always be `edit`. We can assume that is the case. In
the future if other contexts are needed we can address those case by
case.
@BE-Webdesign BE-Webdesign force-pushed the fix/metabox-action-notice branch from 2e261f1 to b68a7e1 Compare October 21, 2017 04:14
@codecov
Copy link

codecov bot commented Oct 21, 2017

Codecov Report

Merging #3092 into master will decrease coverage by 0.53%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3092      +/-   ##
=========================================
- Coverage   32.24%   31.7%   -0.54%     
=========================================
  Files         216     216              
  Lines        6150    6273     +123     
  Branches     1081    1128      +47     
=========================================
+ Hits         1983    1989       +6     
- Misses       3516    3587      +71     
- Partials      651     697      +46
Impacted Files Coverage Δ
blocks/editable/index.js 8.63% <0%> (-1.79%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e869a9d...b68a7e1. Read the comment docs.

@pento pento merged commit d84a798 into master Oct 21, 2017
@pento pento deleted the fix/metabox-action-notice branch October 21, 2017 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants