Open devAsadNur opened 2 days ago
The recent changes to BecomeAVendor.php
involve adding two significant checks in the load_customer_to_vendor_update_template
function: an admin status check using is_admin()
and an enhanced error handling mechanism that verifies REST_REQUEST
before sending a JSON error response. These modifications aim to improve security and error handling, addressing the fatal error reported when creating a page with the customer migration short-code.
File | Change Summary |
---|---|
includes/Frontend/MyAccount/BecomeAVendor.php |
Added is_admin() check at the beginning of load_customer_to_vendor_update_template function and modified error handling to check for REST_REQUEST before sending a JSON error response. |
Objective | Addressed | Explanation |
---|---|---|
Check for admin status using is_admin() at the beginning of the function (Issue #3457) |
β | |
Modify error handling to check REST_REQUEST before sending a JSON error response (Issue #3457) |
β |
In the code where vendors rise,
Errors lurked in soft disguise.
Admin checks and REST now in play,
Keeping those fatal flaws away.
A fix so neat like morning dew,
With a whisper, βHere's to you!β
β¨π°
[!TIP]
AI model upgrade
## `gpt-4o` model for reviews and chat is now live OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our [Discord Community](https://discord.com/invite/GsXnASn26c) to provide any feedback or to report any issues.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All Submissions:
Changes proposed in this Pull Request:
Related Pull Request(s)
Closes
How to test the changes in this Pull Request:
Changelog entry
fix: Fatal error in block editor on adding and editing page with customer-migration shortcode
Detailed Description of the pull request. What was previous behaviour and what will be changed in this PR.
Before Changes
Describe the issue before changes with screenshots(s).
After Changes
Describe the issue after changes with screenshot(s).
Feature Video (optional)
Link of detailed video if this PR is for a feature.
PR Self Review Checklist:
FOR PR REVIEWER ONLY:
Summary by CodeRabbit