Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.8, 1.9
-
Fix Version/s: None
-
Component/s: Forms Library
-
Labels:None
-
Affected Branches:MOODLE_18_STABLE, MOODLE_19_STABLE
Description
If you try to add an 'htmleditor' form element, using 'createElement' (for use in a group, for example), it generates the error:
"Fatal error: Call to undefined method [caller object]::getAttribute() in [moodleroot]/lib/form/textarea.php on line 73"
'addElement' does work.
It appears that there is a specific trap for 'createElement' event in the '/lib/form/textarea.php' that is trying to use the getAttribute method on the caller object. This object may not have this method, and its likely its assuming a different caller anyway (probably from addElement?).
I used a workaround to use getAttribute only if the caller variable is an object and has that method, but I don't think that's the correct solution. Not sure what should be done.
This workaround will not let me use setHelpButton on the 'htmleditor' though.
Thanks for reporting this issue.
We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.
If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.
Michael d;
lqjjLKA0p6