Automattic / Automattic/jetpack

PHP Notice from Contact form when CPT does not support author / author not set

Open
#11,250 3 comments 0 reactions 0 assignees View on GitHub
[Feature] Forms [Focus] Blocks [Pri] Low Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

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](https://user-images.githubusercontent.com/2474435/52162191-0e7e8c80-26c8-11e9-98fe-2837dce5f8db.png)

#### 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](https://user-images.githubusercontent.com/2474435/52162293-8ac59f80-26c9-11e9-8ed0-e4599a1f10ef.png)

Contributor guide

Open the contributing guide

Research direction

Reproduce the notice using the listed Form block steps, then inspect grunion-contact-form.php around line 1813. Done means the same form renders without the reported PHP Notice when the author is unavailable or unset.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.