Skip to content

remove unused attributes#26

Merged
brendanheywood merged 1 commit into
MOODLE_35_STABLEfrom
remove-unused-actionurl
May 26, 2025
Merged

remove unused attributes#26
brendanheywood merged 1 commit into
MOODLE_35_STABLEfrom
remove-unused-actionurl

Conversation

@jay-oswald

Copy link
Copy Markdown
Contributor

Removing $this->actionurl from the forms, its throwing an error in php 8.3 because you can no longer create parameters dynamically.

Both these classes extend moodleform class, which ofcourse dosen't have actionurl paramater, or we wouldn't get this error in the first place. The only time action is ever passed through it on __contruct, and is never stored anywhere just used, and passed through to $this->_form which uses the class MoodleQuickForm

MoodleQuickForm also never stores action as a variable either, it is just saved to $this-> _attributes array, so it is not possible with the code I can see that $this->actionurl is doing anything.

It is possible on older versions of Moodle it has done something, though looking at blame on the relevant classes, this is very very old moodle code so I doubt it. I think it was just an attempt to set action url initially and its stuck around.

We do pass through action as a paramater to the constructor properly anyway, so it does work the proper method

@jay-oswald jay-oswald force-pushed the remove-unused-actionurl branch from dbdc969 to 27f2e86 Compare May 23, 2025 05:24
@brendanheywood brendanheywood merged commit d123a5e into MOODLE_35_STABLE May 26, 2025
8 checks passed
@brendanheywood brendanheywood deleted the remove-unused-actionurl branch May 26, 2025 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants