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

PHP notice when logging changes to menu items if ACF fields attached #235

Closed
anugupta opened this issue Jan 22, 2021 · 0 comments · Fixed by #248
Closed

PHP notice when logging changes to menu items if ACF fields attached #235

anugupta opened this issue Jan 22, 2021 · 0 comments · Fixed by #248

Comments

@anugupta
Copy link

PHP Notice: Trying to access array offset on value of type null in <wp-root>/wp-content/plugins/simple-history/loggers/Plugin_ACF.php on line 272

I guess the issue is that it's not a post that's being saved, but I was able to remove the notice by changing from:
if ($post_id === $post_logger->lastInsertContext['post_id']) {

to:

if ( isset($post_logger->lastInsertContext['post_id']) && $post_id === $post_logger->lastInsertContext['post_id']) {

I didn't really investigate further, so unsure if this is the best way to fix, but perhaps this will help someone.

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 a pull request may close this issue.

1 participant