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 from Contact form when CPT does not support author / author not set #11250

Open
bobbingwide opened this issue Feb 2, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@bobbingwide
Copy link
Contributor

commented Feb 2, 2019

I've updated the issue title to better reflect the underlying problem.

Steps to reproduce the issue

  1. Add a Form block.
  2. Remove all the default fields.
  3. Insert a Checkbox
  4. Save
  5. View.
  6. See Notice

f32c9b1a-0469-4fc4-b984-1fa42d8e14c2

What I expected

I was creating this form to catalog the Jetpack-field/checkbox at
https://jetpack.wp-a2z.org/block/checkbox-jetpack-field-checkbox

I didn’t expect to see any Notices.

What happened instead

Notice: Trying to get non-property object ... grunion-contact-form.php on line 1813

Screenshots
See above plus
5f997fdd-6b51-4a5b-9c65-977610b10bba

@bobbingwide

This comment has been minimized.

Copy link
Contributor Author

commented Feb 2, 2019

Note: I’ve not done any debugging. I got the same problem with a default Checkbox group block.

Just realised I get it from the basic Contact form too.
Steps.

  1. Insert Form block.
  2. Save
  3. View
  4. See Notice
@bobbingwide

This comment has been minimized.

Copy link
Contributor Author

commented Feb 2, 2019

Note: Presently my block CPT does not have post type support author.

@bobbingwide bobbingwide changed the title PHP Notice from Contact form with just a checkbox PHP Notice from Contact form when CPT does not support author / author not set Feb 2, 2019

@bobbingwide

This comment has been minimized.

Copy link
Contributor Author

commented Feb 2, 2019

Workaround

For my site I added post type support for 'author' to the CPTs where this setting was missing.
I then needed to set the author for each post to ensure the problem went away.
See bobbingwide/oik-shortcodes#61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.