Issue Details (XML | Word | Printable)

Key: MDL-10501
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Jamie Pratt
Reporter: Mike Churchward
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Can't use 'createElement' with 'htmleditor' element type

Created: 18/Jul/07 01:58 AM   Updated: 18/Jul/07 02:32 AM
Return to search
Component/s: Forms Library
Affects Version/s: 1.8, 1.9
Fix Version/s: None

Participants: Jamie Pratt and Mike Churchward
Security Level: None
Affected Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
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.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.