v2.8.5 - "More" theme problems

v2.8.5 - "More" theme problems

by Petras Virzintas -
Number of replies: 32

We have two Moodle sites with identical software version 2.8.5.

Certain pages such "Enrolled Users" one one site have a blank "side-pre" region - the other doesn't. (See attached)

The page that has the blank "side-pre" region does not have the sections "Skip-Navigation" etc rendered in the HTML.

Can anyone guide me where to look to fix this?

Rgds
Petras



Attachment empty.jpg
Average of ratings: -
In reply to Petras Virzintas

Re: v2.8.5 - "More" theme problems

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

I think this is being caused by a hidden block or blocks on that page. So try enabling 'Editing' on the page where there are no side-blocks, because I suspect there are is a hidden block there.

Cheers

Mary

In reply to Mary Evans

Re: v2.8.5 - "More" theme problems

by Petras Virzintas -

Thanks for the reply.

Unfortunately the pages that have the "empty" column are "maintenance" pages such as "Enrolled Users" or "Grades" which do not have blocks and no "Turn Editing On" facility.

Rgds
Petras


In reply to Petras Virzintas

Re: v2.8.5 - "More" theme problems

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Sorry to say you have got that wrong. Enrolled Users and Grades use the Admin layout which has a block region (side-pre) and  main content. So I am at a loss as to what has happened to the blocks that should be there, like Administration.

Are both sites using the same 'More' theme? If they are then someone has changed the configuration file (config.php) for that problem site. I suggest you take a look to see which file is being used for the Admin layout.

If you are not convinced I am right about this, go to Site Administration > Development > Debugging and enable "Show page information". The name of the layout will be printed in the footer of the page.

Thanks

Mary

In reply to Mary Evans

Re: v2.8.5 - "More" theme problems

by Petras Virzintas -

Both sites software are identical.

Ok. Turned on debugging. Here is the information from the "Backup/Restore" page:

This page is: General type: admin. Context Course: L5L15T3PAF-LEDCHA501A Leadership Ethics (Parramatta Campus) Semester 2, 2015 (context id 202497). Page type backup-restorefile.

Which config file do I need to change?

FYI: We did change the "base" theme config file so that default region was "side-post" where applicable. This was to stop the obnoxious "Add block" block opening an empty left column whenever "Turn on Editing" was clicked.

Rgds
Petras



In reply to Petras Virzintas

Re: v2.8.5 - "More" theme problems

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

This is what I am talking about:

This page is: General type: admin.

OK...when you say the 'base' theme was changed, do you mean the Base theme ? Or do you really mean Clean theme (because More theme uses Clean theme layout files)?

I will assume we are now talking about the 'Clean' theme layout files that are set to have block on the left hand side for Admin and Report pages. (columns2.php) They are built to do that, they cannot do anything else unless you change your language to Hebrew or Arabic! Then the side blocks will got to the right.

What you have now is a mess!  Which makes me want to ask do you want the blocks or not?

Mary

In reply to Mary Evans

Re: v2.8.5 - "More" theme problems

by Petras Virzintas -

We only changed the config file in "base" because that was the one that fixed the "Add Block" block.

Both sites have the same "base" config file.

We have not changed anything else in "clean" or any other theme config file.

I can easily restore the original "base" config file.

I still feel that there is something in the table "block_postions" that is causing the difference.

Rgds
Petras


In reply to Petras Virzintas

Re: v2.8.5 - "More" theme problems

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

You said you are using the More theme, so why change base theme?  Base has nothing what soever to do with More.

Yes altering the side the Add block goes in can be done in the Base theme providing you are using the old themes. I thought you said you are using the More theme?  More and Base have nothing in common and they certainly don't share layouts or CSS.

So what changes have you or your team made to make the More theme behave like it is?

In reply to Mary Evans

Re: v2.8.5 - "More" theme problems

by Petras Virzintas -

As I said, the only theme config file we changed was "base" because that was the only one that fixed the "Add Block" block.

The "fix" was to change the "default region" which does not exist in the "clean" or "more" config files.

Perhaps we shouldn't have changed all the "default regions".

However, both sites have identical "base" config files yet behave differently which leads me to believe that the difference is in the database not the software.

Rgds
Petras




In reply to Petras Virzintas

Re: v2.8.5 - "More" theme problems

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

You must be meaning Bootstrapbase which is a totally different theme than Base theme.

If you have done what I think you have, then the problem is that you have broken the layout and therefore the CSS will not be fulfilling its role.

https://github.com/lazydaisy/moodle/blob/master/theme/bootstrapbase/config.php#L81-L86

which is in BootstrapBase theme. 

If this is the sectioned you changed then you would be better changing columns2.php to columns3.phplike so,,,

 // Server administration scripts.
    'admin' => array(
'file' => 'columns2.php',
        'file' => 'columns3.php',
        'regions' => array('side-post'),
        'defaultregion' => 'side-post',
    ),

that way you would get a side post only layout rather than a side pre as it was meant to be.

Cheers

Mary

In reply to Mary Evans

Re: v2.8.5 - "More" theme problems

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Just to clarify what Mary is saying for you.

If you are using More, then its parents are Clean and BootstrapBase - at no point does the Base theme come into it at all

https://github.com/moodle/moodle/blob/master/theme/more/config.php#L26

If you are using the older themes such as canvas, standard, anomaly, etc then the parent is Base (or canvas and base).

https://github.com/moodle/moodle/blob/master/theme/canvas/config.php#L42


Changing the Base theme would have no affect on More at all in a default setup, so if you have changed Base and that has 'fixed' your More theme, then someone at some point has tinkered with your More theme and broken it by applying an unrelated parent to it.

Perhaps you can clarify that you are indeed using the More theme and that is what your post title referred to, rather than you are experiencing additional (more) issues  with your theme - in which case, what theme are you using that might then have 'base' as a parent? The first is what I have assumed - and Mary also - but knowing how the English language complicates everything, I thought I would check to ensure there hasn't been any confusion smile


Also, as the bootstrapbase theme (or any parent theme) can potentially affect every other theme built on it, you should really make the changes in your own theme rather than changing the parent - in this case, copy the array relating to the layouts from bootstrapbase into your (clone of) More and make the changes there.

Richard

In reply to Richard Oelmann

Re: v2.8.5 - "More" theme problems

by Petras Virzintas -

OK.

We have not modified "More" in any way and we are well aware that the parents are "Clean" and "Bootstrapbase".

What we were trying to fix (and it is fixed on one site) is the obnoxious "Add Block" block which insists in opening itself in an empty "side-pre" and changing pages to three-columns when we just want two.

I had read the "Add Block" block determines which column to use from the first "default region" it can find - hence we changed the "base" config file which seems to work.

If there is a better way to fix "Add Block" block and/or force "More" to use two-columns we would be very happy.

Rgds
Petras


In reply to Petras Virzintas

Re: v2.8.5 - "More" theme problems

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

In that case Petras, I am very tempted to say, YOU broke it, so YOU fix it.

When you have the More theme working correctly then come back and ask how to disable the ADD BLOCK block correctly!

Cheers

Mary

In reply to Mary Evans

Re: v2.8.5 - "More" theme problems

by Petras Virzintas -

Thanks for the previous suggestion about the "bootstrapbase" theme  - I'll give it a go.

As for "More" - I repeat - we have NOT changed "More" or any related theme.

All we did was to go through the "Base" config file and change "default-region" from "side-pre" to "side-post".

Both sites have the SAME "Base" theme yet behave differently.

Rgds
Petras



In reply to Petras Virzintas

Re: v2.8.5 - "More" theme problems

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Petras,

In one post you state "Both sites software are identical." then above you state "and it is fixed on one site" - therefore the sites are NOT identical and hence Mary and Richard appear to be running around on a pointless wild Goose chase trying to determine what the 'oddity' is.  And it also appears that the 'fix' has introduced the bug.

The way forward as I believe already implied is to remove the 'custom' fix applied to the base theme.  In fact, given that you state "As I said, the only theme config file we changed was "base" because that was the only one that fixed the "Add Block" block." therefore, please do post that 'change' and it may shed some light on this.

Gareth

In reply to Gareth J Barnard

Re: v2.8.5 - "More" theme problems

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

The mind boggles at what people do to get rid of the Add Block.

Yes...Petras, I dare you to post the changes you made to the Base config...if it fixes the Add Block everyone will be jumping up and down for joy!

By the way...here is a bit of CSS for you...

.block_adminblock { display: none}

Cheers

Mary

In reply to Mary Evans

Re: v2.8.5 - "More" theme problems

by Petras Virzintas -

Better still, perhaps the author of the "Add Block" block could add a setting "default-region" and we would never have this conversation.

Rgds
Petras

In reply to Gareth J Barnard

Re: v2.8.5 - "More" theme problems

by Petras Virzintas -

Thanks for your input.

I have repeatedly said - we have NOT changed "More" or any related theme.

Both sites have identical software (including the modified "Base" config file) and the "Add block" block is now correctly displayed on "side-post".

However, on one site, on certain "maintenance" pages, there is an empty "side-pre" which we would like resolved.

Rgds
Petras

In reply to Petras Virzintas

Re: v2.8.5 - "More" theme problems

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

On the site with the issue, are there any blocks at all in 'side-pre' and are there blocks in 'side-pre' on the site without the issue on the affected pages?  Editing is always off?

Plus, please do post the changes to the 'base' theme for "Add block" as there could be a side effect that you don't know about, but Mary, Richard and I would spot if only we knew what you'd written.  Help us help you.

In reply to Gareth J Barnard

Re: v2.8.5 - "More" theme problems

by Petras Virzintas -

As I replied to Mary, all we did was to change the "default-region" of all the blocks in "Base" config file from "side-pre" to "side-post.

If the software is identical on both sites, then the difference must be in the database - "block_positions" tables?

Rgds
Petras


In reply to Mary Evans

Re: v2.8.5 - "More" theme problems

by Petras Virzintas -

SOLVED: Mary's suggestion to change the config file in "bootstrapbase" (see attached) resolved the empty "side-pre" column for "maintenance" pages.

I have now restored the original "base" config file to both sites. Hopefully a fix for the "Add Block" block will turn up.

Thanks everyone. But please - can the author of "Add Block" block put in a setting of "default-region".

Rgds
Petras

Attachment fixed.jpg
In reply to Petras Virzintas

Re: v2.8.5 - "More" theme problems

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

For "Add Block" position, that is a core thing, so as nothing in Moodle will happen unless you make it happen... See if there is an existing Moodle Tracker for it, if not, raise one, suggest a fix with testing.

In reply to Petras Virzintas

Re: v2.8.5 - "More" theme problems

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Petras, 

The ADD BLOCK block is a 'Fake' block and is hard coded as such in Moodle core code.

It is a strange beast but the fact your two sites were behaving differently is odd. Also the fact that More was not working as you thought, goes to prove changing Base theme has no effect on Bootstrap themes since they are coded differently, and work as two separate entities.

That said, what intrigues me the most about this, is that your other site was working OK. Which makes me think it must be something else that was causing the problem.

Anyway, glad your site is fixed!

Cheers

Mary

In reply to Mary Evans

Re: v2.8.5 - "More" theme problems

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Interestingly "Add a block" is not a fake block, it is unique: https://github.com/moodle/moodle/blob/MOODLE_28_STABLE/lib/blocklib.php#L1916-L1954 and instigated in the default region here: https://github.com/moodle/moodle/blob/MOODLE_28_STABLE/lib/blocklib.php#L1024-L1029 - whereas fake blocks have a 'block_fake' CSS selector added: https://github.com/moodle/moodle/blob/MOODLE_28_STABLE/lib/blocklib.php#L466.  Therefore as it is already the 'default-region' then there is no problem to solve.

Of odd note though, that if 'bootstrapbase' does not have a 'layout' then the code still checks 'base' even though its not a parent.

In reply to Gareth J Barnard

Re: v2.8.5 - "More" theme problems

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Does it check Base? Should it be checking base?

We need to test this with no layout files and see what happens!

I made Base theme the child of Bootstrapbase a few weeks ago and was totally gob-smacked at how it looked.

I meant to say something about it but forgot until now!

Cheers

Mary

In reply to Mary Evans

Re: v2.8.5 - "More" theme problems

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

I don't think it gets the layout files, but it does check against base to check that all of the layout elements in the layouts array exist.  Off the top of my head I don't know what line of code it is, but if you perform a structured walk-through of the theme loading code you'll find it.

In reply to Gareth J Barnard

Re: v2.8.5 - "More" theme problems

by Petras Virzintas -

When you say "structured walk-through", which software tool do you use?

Rgds
Petras

In reply to Petras Virzintas

Re: v2.8.5 - "More" theme problems

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Notepad++ which is a text editor, i.e. looking at the path undertaken from start to finish in the same sort of process you would use to reverse engineer an object interaction diagram (even though from this point of view its functional) .

In reply to Gareth J Barnard

Re: v2.8.5 - "More" theme problems

by Petras Virzintas -

I have used Notepad++ for many years but I have never seen how to "reverse engineer" PHP code.

Perhaps there is a plug-in?

Rgds
Petras


In reply to Petras Virzintas

Re: v2.8.5 - "More" theme problems

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

I think Gareth means just read it and work out what's happening.

In reply to Mary Evans

Re: v2.8.5 - "More" theme problems

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

As Mary implies, yes I do.  The plugin is a biological optical sensor coupled to a neural net that is employed to produce something like this: http://en.wikipedia.org/wiki/Unified_Modeling_Language#Interaction_diagrams - which is normally created before the code.