kordan / moodle-mod_surveypro

The surveypro module per moodle
13 stars 15 forks source link

Changed the mform element to display autofill #914

Closed kordan closed 8 months ago

kordan commented 10 months ago

The issue is this: giving a parent to an autofill item the autofill form element is disabled at first form load (because it is an autofill and the <input type="text"> has disabled="disabled") but changing the answer to the parent item the autofill may be enabled by js. Now I changed the mform element. It is no longer a disabled input text but a plain label.

In the frame of this PR I also changed the name of method "userform_set_prefill" of each item class to the more correct "userform_get_prefill".

This PR should be cherry-picked to MOODLE_401|402|403_STABLE too.

stronk7 commented 10 months ago

Does this PR depend on #913 and has to be merged only after it?

kordan commented 10 months ago

I propose to procede in order. I start to work on #913 and, once #913 and company will be merged, this one will be simple to merge wherever.

stronk7 commented 8 months ago

You must be careful when changing method names. Imagine I've created a field (subplugin) with that userform_set_prefill() method. When updating to the master (this) version, it will stop working.

No matter of that, I'm going to merge this now (master only, as agreed).

Ciao :-)