Problem/Motivation

I haven't filled out all fields to see if I can save. So I filled out everything except the end time. The following error then occurred
Error: Unsupported operand types in Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateWidgetBase->massageFormValues() (line 276 of /modules/smart_date/src/Plugin/Field/FieldWidget/SmartDateWidgetBase.php).

Comments

HeavyStoneHead created an issue. See original summary.

mandclu’s picture

Hmmm seems like I'll need more steps to reproduce:

What type of entity are you using?

mandclu’s picture

heavystonehead’s picture

standard field type with the widget works fine. (I couldn't reproduce)

"Smart date range" fieldtype with a given time also works fine. However, if you switch to custom and leave the end date free, this error occurs.

mandclu’s picture

I'm still not sure I understand. Is this on a custom entity? Could you provide detailed steps to reproduce?

heavystonehead’s picture

StatusFileSize
new130.37 KB

basically the same steps as you, only with custom / user-defined

I hope the shape is okay

mandclu’s picture

StatusFileSize
new738 bytes

basically the same steps as you, only with custom / user-defined

If you're using Smart Date as a base field on a custom entity, you may need to provide your own validation logic.

This patch should fix the specific error you're getting, but I'm not sure if it will ensure the field behaves as expected.

heavystonehead’s picture

Status: Active » Reviewed & tested by the community

If you're using Smart Date as a base field on a custom entity, you may need to provide your own validation logic.

this confuses me a little and am not sure if i can follow them. I only use your field, nothing more. sorry if I don't understand something.

In any case, it works, I get the feedback I expected, thank you.

  • mandclu committed 9be00ba on 3.1.x
    Issue #3178586 by mandclu, HeavyStoneHead: Error: message function (...
mandclu’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the feedback, merged this in.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.