-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: Error when calling the PostActions view-post
callback
#63460
Fix: Error when calling the PostActions view-post
callback
#63460
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @sejas! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
@jorgefilipecosta , could you take a look if this is the right direction for this fix? Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can reproduce the error, and the fix makes sense.
I'm not super familiar with post actions, so will leave final approval to @jorgefilipecosta.
This makes sense to me 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tha change look good, thank you for this fix 👍
Co-authored-by: sejas <antoniosejas@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
I just cherry-picked this PR to the release/18.8 branch to get it included in the next release: e0afea2 |
Co-authored-by: sejas <antoniosejas@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
What?
Fixes the error thrown when clicking PostActions View post in the editor.
Why?
In #63120 we added support for
onActionPerformed
at action level, but I've observed the object is undefined in all the cases.I could check.
onActionPerformed
is only used at hook level instead. If we need to remove the logic that unpacksargsObject
, I'm happy to update this PR or open a new one.How?
Add a condition in case the callback options
argsObject
is undefined.Testing Instructions
/wp-admin/post.php?post=1&action=edit
.Testing Instructions for Keyboard
Screenshots or screencast
Before
post-action-view-before.mp4
After
post-action-view-after.mp4