Forums | Mahara Community
Support
/
Mahara 1.9 - edit page function doesn't seem to work?
17 April 2014, 22:18
Hi
I have zero technical knowledge so have recorded screencast of what the problem is. Any help gratefully accepted.
http://tcol-tutorials.ac.nz/p6w4nku0tzn/
20 April 2014, 16:32
Hi David,
I tried installing the Essential theme on my 1.10dev site and it worked fine for me in Firefox and Chrome. What version of Mahara are you using?
As the Essential theme is not part of core Mahara it might be worth contacting the theme creator about your issue. This forum post has more details.
Cheers
Robert
21 April 2014, 8:52
Thanks for that link, Robert. I suspect it is a bug in mahara 1.9 rather than a problem with essential theme which worked fine for us in 1.8 Very grateful for your help.
22 April 2014, 8:14
Hi David,
I've tested the essential theme in Mahara 1.9 and I am unable to replicate your problem. There could indeed be a bug in Mahara 1.9 that is causing your issue but it hard to tell what exactly is causing things to go wrong.
The files for the essential theme that I am testing with come from the zip file on the page in the earlier post.
Are your Essential theme files possibly older/out of date?
Are you able to view the error logs to see if there is any useful errors occuring when you try adding a blcok to a page?
Is the browser showing any javascript errors?
Cheers
Robert
22 April 2014, 9:38
Hi robert
i got the following information from the company that runs our server. I am sorry it means nothing to me, but if there is a wider problem it may possibly be helpful?
"Stack trace (usually hidden) when failure occurs in Chrome:
"TypeError: Cannot read property 'addEventListener' of null
at MochiKit.Base.update.connect (http://mahara.tcol.ac.nz/js/MochiKit/Packed.js?v=1.9.0:4662:16)
at Pieform.init (http://mahara.tcol.ac.nz/lib/pieforms/static/core/pieforms.js?v=1.9.0:148:49)
at eval (eval at <anonymous> (http://mahara.tcol.ac.nz/js/views.js?v=1.9.0:1342:29), <anonymous>:1:390)
at http://mahara.tcol.ac.nz/js/views.js?v=1.9.0:1342:13
at addConfigureBlock (http://mahara.tcol.ac.nz/js/views.js?v=1.9.0:1343:11)
at http://mahara.tcol.ac.nz/js/views.js?v=1.9.0:555:17
at d.addCallbacks.document.documentElement.style.cursor (http://mahara.tcol.ac.nz/js/mahara.js?v=1.9.0:248:23)
at Object.MochiKit.Async.Deferred._fire (http://mahara.tcol.ac.nz/js/MochiKit/Packed.js?v=1.9.0:2229:5)
at cb (http://mahara.tcol.ac.nz/js/MochiKit/Packed.js?v=1.9.0:2236:6)
at Object.MochiKit.Async.Deferred._fire (http://mahara.tcol.ac.nz/js/MochiKit/Packed.js?v=1.9.0:2229:5)""
23 May 2014, 7:48
Im getting the same when editting a page, specifically when trying to add a text filed or image on the Edit content tab:
ERROR: sendjsonrequest() callback failed: TypeError: Cannot read property 'addEventListener' of null [object Object] Packed.js?v=1.9.1:1757
23 May 2014, 9:05
Hi Herson, thanks for your report. Have you made any notable modifications to your installed plugins - or od you have a list of plugins installed? It might be worth comparing since we seem to find a common point.
Note that we rolled back from 1.9.0 to 1.8.1 which was successful as a workaround, but we'll obviously be holding off on 1.9.1 since it sounds like we'd see the same issue anyway.
23 May 2014, 9:39
Hi Herson,
As I am not able to replicate this error can you do a test for me?
Can you edit the htdocs/js/views.js file and add this line:
console.log(configblock.javascript);
below this line (approx line 1339):
appendChildNodes(document.body, DIV({id: 'overlay'}));
Then in Firefox (with firebug plugin added) can you let me know what the console message is? It should be a bunch of lines beginning with 'var pf_instconf ='
I believe the data that is trying to render the 'instconf' form is somehow wrong for you and hence why the form doen't appear, but I'm not sure what exactly is wrong.
Cheers
Robert
24 May 2014, 2:37
Hi Robert,
Here is the output for your request:
---
Attr.specified is deprecated. Its value is always true. jquery.js?v=1.9.1:2378
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. jquery.js?v=1.9.1:3445
var pf_instconf = new Pieform({"name":"instconf","jsForm":true,"submitButtons":["action_configureblockinstance_id_1523"],"preSubmitCallback":"formStartProcessing","jsSuccessCallback":"blockConfigSuccess","jsErrorCallback":"blockConfigError","globalJsErrorCallback":"formGlobalError","postSubmitCallback":"formStopProcessing","newIframeOnSubmit":false,"checkDirtyChange":true});pf_instconf.init();
tinyMCE.idCounter=0;
tinyMCE.execCommand('mceAddControl', false, "instconf_text");
PieformManager.connect('onsubmit', "instconf", tinyMCE.triggerSave);
PieformManager.connect('onreply', "instconf", function () {
tinyMCE.execCommand('mceRemoveControl', false, "instconf_text");});var p = new Paginator("artefactid_pagination", "artefactid_data", null, "view\/artefactchooser.json.php", {"value":null,"blocktype":"textbox","group":null,"institution":null});
var acSelectArtefacts = []
var ul = getFirstElementByTagAndClassName('ul', 'artefactchooser-tabs', 'instconf_artefactid_container');
var doneBrowse = false;
var browseA = null;
var searchA = null;
var browseTabCurrent = true;
if (ul) {
forEach(getElementsByTagAndClassName('a', null, ul), function(a) {
p.rewritePaginatorLink(a);
if (!doneBrowse) {
doneBrowse = true;
browseA = a;
// Hide the search form
connect(a, 'onclick', function(e) {
hideElement('artefactchooser-searchform');
removeElementClass(searchA.parentNode, 'current');
getFirstElementByTagAndClassName(searchA, null, 'accessible-hidden').innerHTML = '(' + get_string('tab') + ')';
addElementClass(browseA.parentNode, 'current');
getFirstElementByTagAndClassName(browseA, null, 'accessible-hidden').innerHTML = '(' + get_string('tab') + get_string('selected') + ')';
browseA.blur();
$('artefactchooser-searchfield').value = ''; // forget the search for now, easier than making the tabs remember it
if (!browseTabCurrent) {
browseTabCurrent = true;
}
e.stop();
});
}
else {
searchA = a;
// Display the search form
connect(a, 'onclick', function(e) {
showElement('artefactchooser-searchform');
removeElementClass(browseA.parentNode, 'current');
addElementClass(searchA.parentNode, 'current');
connect('artefactchooser-searchfield', 'onkeypress', function(e) {
if (e.key().code == 13) { // enter pressed - submitting form
e.stop();
signal('artefactchooser-searchsubmit', 'onclick', true);
}
});
// Wire up the search button
connect('artefactchooser-searchsubmit', 'onclick', function(e) {
if (e._event != true) {
e.stop();
}
var loc = searchA.href.indexOf('?');
var queryData = [];
if (loc != -1) {
queryData = parseQueryString(searchA.href.substring(loc + 1, searchA.href.length));
queryData.extradata = serializeJSON(p.extraData);
// need to do this old school as the mochikit js is being called on a jquery page
queryData.search = document.getElementById('artefactchooser-searchfield').value;
}
sendjsonrequest(p.jsonScript, queryData, 'GET', function(data) {
var tbody = getFirstElementByTagAndClassName('tbody', null, p.datatable);
if (tbody) {
if (
(document.all && document.documentElement && typeof(document.documentElement.style.maxHeight) != "undefined" && !window.opera)
||
(/Konqueror|AppleWebKit|KHTML/.test(navigator.userAgent))) {
var temp = DIV({'id':'ie-workaround'});
temp.innerHTML = '<table><tbody>' + data.data.tablerows + '</tbody></table>';
swapDOM(tbody, temp.childNodes[0].childNodes[0]);
}
else {
// This does not work in IE and Konqueror, the tbody
// innerHTML property is readonly.
// http://www.ericvasilik.com/2006/07/code-karma.html
tbody.innerHTML = data['data']['tablerows'];
}
}
new ArtefactChooserSelect(data.data.artefactdata);
// Update the pagination
if ($(p.id)) {
var tmp = DIV();
tmp.innerHTML = data['data']['pagination'];
swapDOM(p.id, tmp.firstChild);
// Run the pagination js to make it live
eval(data['data']['pagination_js']);
// Update the result count
var results = getFirstElementByTagAndClassName('div', 'results', p.id);
if (results) {
results.innerHTML = data['data']['results'];
}
}
});
});
$('artefactchooser-searchfield').focus();
if (browseTabCurrent) {
browseTabCurrent = false;
}
e.stop();
});
}
});
}/**
* Call the selectjscallback function whenever a radio button is clicked
*/
function ArtefactChooserSelect(artefacts) {
var self = this;
this.artefacts = artefacts;
this.init = function() {
self.connectPagination();
self.connectRadios();
}
/**
* Connects pagination so that when a page is changed, we are told about it
*/
this.connectPagination = function() {
paginatorProxy.addObserver(self);
connect(self, 'pagechanged', self.pageChanged);
}
/**
* Update artefact data & connect radios to the selectjscallback
*/
this.pageChanged = function(data) {
self.artefacts = data.artefactdata;
self.connectRadios(data);
}
this.connectRadios = function(data) {
forEach(getElementsByTagAndClassName('input', null, 'artefactid_data'), function(radio) {
connect(radio, 'onclick', function() {
if (self.artefacts[radio.value]) {
updateTextContent(self.artefacts[radio.value]);
}
});
});
}
self.init();
}
new ArtefactChooserSelect(acSelectArtefacts);
instconf_artefactids = new FileBrowser('instconf_artefactids', 0, {"upload":1,"resizeonuploaduseroption":0,"resizeonuploaduserdefault":1,"uploadagreement":1,"createfolder":0,"edit":0,"tag":1,"select":1,"alwaysopen":1,"publishing":1,"selectone":0,"showtags":1,"editmeta":1}, config);
instconf_artefactids.filedata = [];instconf_artefactids.selecteddata = [];instconf_artefactids.tabdata = {"tabs":{"user":"My files","group":"Group files","site":"Site files"},"subtabs":[],"owner":"user","ownerid":null,"upload":true}; instconf_artefactids.init();function updateTextContent(a) {
setNodeAttribute('instconf_title', 'value', a.title);
tinyMCE.activeEditor.setContent(a.description);
setNodeAttribute('instconf_license', 'value', a.license);
setNodeAttribute('instconf_licensor', 'value', a.licensor);
setNodeAttribute('instconf_licensorurl', 'value', a.licensorurl);
jQuery('#instconf_textreadonly_display').innerHTML = a.safedescription;
jQuery('#instconf_licensereadonly_display').innerHTML = a.safelicense;
setNodeAttribute('instconf_tags', 'value', a.tags);
jQuery('#instconf_textreadonly_display').innerHTML = a.safedescription;
jQuery('#instconf_tagsreadonly_display').innerHTML = a.safetags;
jQuery('#instconf_makecopy').prop('checked', false);
if (a.editable == 1) {
addElementClass('instconf_textreadonly_header', 'hidden');
addElementClass('instconf_textreadonly_container', 'hidden');
addElementClass('instconf_readonlymsg_container', 'hidden');
addElementClass('instconf_licensereadonly_header', 'hidden');
addElementClass('instconf_licensereadonly_container', 'hidden');
addElementClass('instconf_tagsreadonly_header', 'hidden');
addElementClass('instconf_tagsreadonly_container', 'hidden');
removeElementClass('instconf_text_header', 'hidden');
removeElementClass('instconf_text_container', 'hidden');
if (jQuery('#instconf_license_header').length) {
// only deal with these if the license metadata is enabled
removeElementClass('instconf_license_header', 'hidden');
removeElementClass('instconf_license_container', 'hidden');
removeElementClass('instconf_license_description', 'hidden');
removeElementClass('instconf_license_advanced_fieldset', 'hidden');
}
removeElementClass('instconf_tags_header', 'hidden');
removeElementClass('instconf_tags_container', 'hidden');
removeElementClass('instconf_tags_description', 'hidden');
var blockcountmsg = jQuery('#instconf_otherblocksmsg_container');
if (blockcountmsg && jQuery('#textbox_blockcount')) {
var otherblockcount = 0;
if (a.blocks && a.blocks.length > 0) {
for (var i = 0; i < a.blocks.length; i++) {
if (a.blocks[i] != 1523) {
otherblockcount++;
}
}
}
if (otherblockcount) {
replaceChildNodes('textbox_blockcount', otherblockcount);
jQuery(blockcountmsg).removeClass('hidden');
}
else {
jQuery(blockcountmsg).addClass('hidden');
}
}
if (typeof a.attachments != 'undefined') {
// remove any attached files
for (var key in instconf_artefactids.selecteddata) {
signal($('instconf_artefactids_unselect_' + key), 'onclick', instconf_artefactids.unselect);
}
// add in ones we need
if (a.attachments.length > 0) {
for (var i = 0; i < a.attachments.length; i++) {
instconf_artefactids.add_to_selected_list(a.attachments[i]);
}
}
}
}
else {
addElementClass('instconf_text_header', 'hidden');
addElementClass('instconf_text_container', 'hidden');
addElementClass('instconf_otherblocksmsg_container', 'hidden');
if (jQuery('#instconf_license_header').length) {
// only deal with these if the license metadata is enabled
addElementClass('instconf_license_header', 'hidden');
addElementClass('instconf_license_container', 'hidden');
addElementClass('instconf_license_description', 'hidden');
addElementClass('instconf_license_advanced_fieldset', 'hidden');
}
addElementClass('instconf_tags_header', 'hidden');
addElementClass('instconf_tags_container', 'hidden');
addElementClass('instconf_tags_description', 'hidden');
removeElementClass('instconf_textreadonly_header', 'hidden');
removeElementClass('instconf_textreadonly_container', 'hidden');
removeElementClass('instconf_readonlymsg_container', 'hidden');
removeElementClass('instconf_licensereadonly_header', 'hidden');
removeElementClass('instconf_licensereadonly_container', 'hidden');
removeElementClass('instconf_tagsreadonly_header', 'hidden');
removeElementClass('instconf_tagsreadonly_container', 'hidden');
}
if (table = getFirstParentByTagAndClassName($('instconf_text_container'), 'table', 'maharatable')) {
updateBlockConfigWidth(getFirstParentByTagAndClassName(table, 'div', 'blockinstance'), getElementDimensions(table).w);
}
}
connect('chooseartefactlink', 'onclick', function(e) {
e.stop();
toggleElementClass('hidden', 'instconf_artefactid_container');
toggleElementClass('hidden', 'instconf_managenotes_container');
});
forEach(getElementsByTagAndClassName('a', 'copytextboxnote', 'instconf'), function(link) {
connect(link, 'onclick', function(e) {
e.stop();
forEach(getElementsByTagAndClassName('input', 'radio', 'artefactid_data'), function(i) {
if (i.checked) {
i.checked = false;
}
});
jQuery('#instconf_makecopy').prop('checked', true);
addElementClass('instconf_textreadonly_header', 'hidden');
addElementClass('instconf_textreadonly_container', 'hidden');
addElementClass('instconf_readonlymsg_container', 'hidden');
addElementClass('instconf_otherblocksmsg_container', 'hidden');
addElementClass('instconf_licensereadonly_header', 'hidden');
addElementClass('instconf_licensereadonly_container', 'hidden');
addElementClass('instconf_tagsreadonly_header', 'hidden');
addElementClass('instconf_tagsreadonly_container', 'hidden');
removeElementClass('instconf_text_header', 'hidden');
removeElementClass('instconf_text_container', 'hidden');
if (jQuery('#instconf_license_header').length) {
// only deal with these if the license metadata is enabled
removeElementClass('instconf_license_header', 'hidden');
removeElementClass('instconf_license_container', 'hidden');
removeElementClass('instconf_license_description', 'hidden');
removeElementClass('instconf_license_advanced_fieldset', 'hidden');
}
removeElementClass('instconf_tags_header', 'hidden');
removeElementClass('instconf_tags_container', 'hidden');
removeElementClass('instconf_tags_description', 'hidden');
});
});
augment_tags_control('instconf_tags');
if (jQuery('#instconf_license').length) {
removeElementClass('instconf_license', 'hidden');
}
if (jQuery('#instconf_license_advanced_fieldset').length) {
removeElementClass(getFirstElementByTagAndClassName('fieldset', null, 'instconf_license_advanced_fieldset'), 'hidden');
}
$j(function() {
$j("#instconf_retractable").click(function() {
if (this.checked) {
$j("#instconf_retractedonload").removeAttr("disabled");
$j("#instconf_retractedonload").removeAttr("checked");
}
else {
$j("#instconf_retractedonload").removeAttr("checked");
$j("#instconf_retractedonload").attr("disabled", true);
}
});
});
views.js?v=1.9.1:1341
ERROR: sendjsonrequest() callback failed: TypeError: Cannot read property 'addEventListener' of null [object Object] Packed.js?v=1.9.1:1757
---
Thanks for your help!
29 May 2014, 8:32
Without any changes in code, I'm getting this shorter output:
---
var pf_instconf = new Pieform({"name":"instconf","jsForm":true,"submitButtons":["action_configureblockinstance_id_1540"],"preSubmitCallback":"formStartProcessing","jsSuccessCallback":"blockConfigSuccess","jsErrorCallback":"blockConfigError","globalJsErrorCallback":"formGlobalError","postSubmitCallback":"formStopProcessing","newIframeOnSubmit":false,"checkDirtyChange":true});pf_instconf.init();instconf_artefactid = new FileBrowser('instconf_artefactid', 0, {"upload":1,"resizeonuploaduseroption":0,"resizeonuploaduserdefault":1,"uploadagreement":1,"createfolder":0,"edit":0,"tag":1,"select":1,"alwaysopen":1,"publishing":1,"selectone":1,"showtags":1,"editmeta":1}, config);
instconf_artefactid.filedata = [];instconf_artefactid.selecteddata = [];instconf_artefactid.tabdata = {"tabs":{"user":"My files","group":"Group files","site":"Site files"},"subtabs":[],"owner":"user","ownerid":null,"upload":true}; instconf_artefactid.init();
$j(function() {
$j("#instconf_retractable").click(function() {
if (this.checked) {
$j("#instconf_retractedonload").removeAttr("disabled");
$j("#instconf_retractedonload").removeAttr("checked");
}
else {
$j("#instconf_retractedonload").removeAttr("checked");
$j("#instconf_retractedonload").attr("disabled", true);
}
});
});
ERROR: sendjsonrequest() callback failed: TypeError: src is null [object Object]
---
- «Previous page
- 1
- 2
- »Next page