Currently the link widget uses form_set_error() to set errors for form elements. This results in form elements not being highlighted correctly when there are errors. The accepted practice is to use hook_field_widget_error() to set errors. Attached patch switches to hook_field_widget_error().

Comments

duellj’s picture

Title: Link widget should you hook_field_widget_error() » Link widget should use hook_field_widget_error()
dqd’s picture

Status: Needs review » Postponed (maintainer needs more info)
StatusFileSize
new91.19 KB

Thanks for report. Can you please provide screenshots from before and after? I wonder why you mention that it doesn't highlight correctly before, because the fields are marked red here correctly without your patch.

Thanks for understanding.

dqd’s picture

Status: Postponed (maintainer needs more info) » Needs work

@duellj,

Aaaaaand ... I would further like to ask you to connect with Damien Tournoud on this for overview. I think he was after the same issue like you for other reasons, but his attempt looks slidely different.

As you may understand, I would like to see the best of both solutions for this in.
Thanks for understanding.

Link to his issue and patch:
#1446814: Use hook_field_validate() API properly

dqd’s picture

Status: Needs work » Closed (duplicate)

hm, ... and I think it is better to merge both issues.

Please use #1446814: Use hook_field_validate() API properly
for follow up discussion and patches.

I close this one here as duplicate since the other issue was older (d.o. rules).
Thanks for all effort on this.

dqd’s picture

Assigned: Unassigned » dqd
Status: Closed (duplicate) » Needs review

ok after chatting with Damien on IRC he gave me the helpful hint, that actually both are needed. So I'll do it, as he recommended to me to do it: First I will commit his patch there and then I will probably add the other patch here manually on top of this if nobody is faster with a reroll.

Therefore I fairly reopen this issue of course.

chris matthews’s picture

Assigned: dqd » Unassigned
Issue summary: View changes
Status: Needs review » Closed (duplicate)