On my dev site where showing notices is enabled, there are 3 notices every time I submit the form because first_name, last_name, and company are technically required in the code (they are passed into the Contact constructor whether or not the fields exist).

There's probably a better way to handle this, but for now, I just added an array of required fields to the $fields array and then assign an empty value to $submittedFields for any fields that don't exist. I'll submit a patch shortly.

Comments

bmcclure created an issue. See original summary.

replicaobscura’s picture

Status: Active » Needs review
StatusFileSize
new871 bytes
mwebaze’s picture

@bmcclure for this particular issue you should have 'constant_contact_block.fields.yml' file in the module. Its in this yml file that the fields are defined. Commenting them out altogether will simply remove them from the form. I probably need to update the documentation on this. Let me know if this helps.

replicaobscura’s picture

It seems to me like the issue here is that, even though you don't have to enable those three fields in the block, the code assumes the fields are always present.

In my opinion, you shouldn't have to manually override the module's .yml file in order to avoid getting PHP notices.

amklose’s picture

StatusFileSize
new860 bytes

Rerolling patch from #2

mwebaze’s picture

Status: Needs review » Fixed
mwebaze’s picture

Status: Fixed » Closed (fixed)