The function taarikh_select_validate didn't work properly, attached patch to fix the error.
The patch needs review.

Scenario:

-Build a custom form and create a form input of #type => taarikh_select select the values to be 4/8/1438

-When submit the validation will be wrong returns error message of undefined index #instance

Reason

- the function taarikh_select_input_date by mistake replace the day with month which returns not exist date.

The simple patch I made to get the date elements from the submittted values, See and review.

Comments

mhmd created an issue. See original summary.

hussainweb’s picture

Status: Active » Needs review
StatusFileSize
new763 bytes

Thank you for the patch. I don't think commenting out the whole block is the right approach.

It seems the warning you get is because the date somehow failed validation and it tried to display an error message. While displaying the error message, it tried to get the field label but since there is no field here, you get a different error. The attached patch fixes that problem.

After applying the patch, you should get a different error. Please let me know what error do you get.

  • hussainweb committed 0527b4e on 7.x-1.x
    Issue #2875605 by mhmd, hussainweb: taarikh select in custom form wrong...
hussainweb’s picture

Status: Needs review » Fixed

I am marking this as fixed for now. If you get an error message for your date (or some other error message), please reopen or create a new issue.

Status: Fixed » Closed (fixed)

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