I installed Moodle 2.6.0 and created a custom Theme based on bootstrapbase.
To Display the blocks I used the same way as in bootstrapbase: echo $OUTPUT->blocks('side-pre', 'span4 desktop-first-column') and echo $OUTPUT->blocks('side-post', 'span3')...
When I turn on the edit mode on my home, I got the Error in the firebug console : TypeError: node is null.
This Error appears with Clean and Essential Themes too!
Suggestion to fix: I got it from this ticket MDL-40446
lib/yui/build/moodle-core-blocks/moodle-core-blocks.js
lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js
< hasblocks = node.all('.'+CSS.BLOCK).size() > 0,
I changed it to
> hasblocks = (node != null) && node.all('.'+CSS.BLOCK).size() > 0,
Can anyone reproduce this with Clean or Essential?
TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
Hi,
Check that your mark-up contains the class 'block-region' for your 'aside' tag when rendering the block....
Probably down to that or broken structure in the layout file as 'create_and_add_node' cannot find the block on line 818 of 'moodle-core_blocks.js' (human readable one, in reality the 'min' one is used). Especially as you have a block region called 'content' initialising, which is odd.
Please post a similar screen shot.
Cheers,
Gareth
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
There is a problem with MyDashboard (My Home) MDL-42953
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
Thanks for the link on tracker Mary, I can replicate on Shoelace.
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
Hi,
In 'moodle-core_blocks.js' the logic here looks iffy:
// Add relevant classes and ID to 'content' block region on My Home page. var myhomecontent = Y.Node.all('body#'+CSS.MYINDEX+' #'+CSS.REGIONMAIN+' > .'+CSS.REGIONCONTENT); if (myhomecontent.size() > 0) { var contentregion = myhomecontent.item(0); contentregion.addClass(CSS.BLOCKREGION); contentregion.set('id', CSS.REGIONCONTENT); contentregion.one('div').addClass(CSS.REGIONCONTENT); }
Given that
CSS = { BLOCK : 'block', BLOCKREGION : 'block-region', BLOCKADMINBLOCK : 'block_adminblock', EDITINGMOVE : 'editing_move', HEADER : 'header', LIGHTBOX : 'lightbox', REGIONCONTENT : 'region-content', SKIPBLOCK : 'skip-block', SKIPBLOCKTO : 'skip-block-to', MYINDEX : 'page-my-index', REGIONMAIN : 'region-main' };
Given that I think " > .'+CSS.REGIONCONTENT" looks for a tag with that class but then adds the same class?
My CSS knowledge is not yet brilliant on use of the '>' operator.
Cheers,
Gareth
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
No wonder it is not working all those divs being added.
It is obvious that the developers have no idea how the layout files work in Moodle standard themes let alone Bootstrap based themes.
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
Hi, I am sorry to say there is little you can do at this stage , only wait for this 'bug' to be fixed as it is a script error and nothing to do with the theme.
This is so frustrating for everyone.
Thanks you for your patience.
Mary
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
OK thank you Mary...
My workaround in the moodle-core-blocks.js works for me for the moment until this bug is fixed
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
Dear Majd,
Thank you so much for posting the screen shot.
Kind regards,
Gareth
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
I had the same issue, an I have tried various bootstrap's themes. In my case, it happens when I hide the Navigation block inside a resource (SCORM, PAGE..) or in the index course, because we like to see the contents without columns.
Majd, there is any ticket opened about this issue? Or we need to reeopen MDL-40446, because is closed (and not relevant to this comportment). Is very important because the use of bootstrap's themes are increasing.
Thanks!
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
Hi, C an you tell me which Moodle version you are using. Is it 2.5.4 or 2.6.1?
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
Hi Mary!
I'm using the last Moodle 2.6.1+ (Build: 20140220)
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
Hi Xavi,
I didn't find any Tickets for this issue. Does this error appear when you move or dock the blocks? Or just when you hide these?
Re: TypeError in Clean, Essential and custom Theme - Moodle 2.6.0
Hi Majd,
Just when I hide the block.